reverse character in php?

Discussion in 'PHP' started by ironmankho, Jul 22, 2011.

  1. #1
    reverse character in php?

    i have this line:

    now i want to like this :

     
    ironmankho, Jul 22, 2011 IP
  2. shaun.php1208

    shaun.php1208 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    You can use below code, and its really works completely.
    <?php

    $str="servers that have PHP & MySQL support. With CubeCart you can quickly setup a powerful online store which can be used to sell digital or tangible products to new";
    $strArr=explode(" ",$str);
    $newstring="";
    for($i=count($strArr);$i>=0;$i++)
    {
    $newstring.=$strArr[$i]." ";
    }
    echo "New updated String = ".$newstring;
    ?>

     
    shaun.php1208, Jul 22, 2011 IP
  3. ironmankho

    ironmankho Active Member

    Messages:
    393
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Fatal error: Maximum execution time of 30 seconds exceeded in /home/tazakha/public_html/mobilewz.com/code.php on line 8


    http://mobilewz.com/code.php


    please tell me what is reason i also test on local host ....but no response
     
    Last edited: Jul 22, 2011
    ironmankho, Jul 22, 2011 IP
  4. ironmankho

    ironmankho Active Member

    Messages:
    393
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Thanks code edit by shaun.php1208..and it works 100%:) ...He is very nice php programmer i am really impress

    <?php

    $str="servers that have PHP & MySQL support. With CubeCart you can quickly setup a powerful online store which can be used to sell digital or tangible products to new";

    $strArr=explode(" ",$str);
    $newstring="";
    for($i=count($strArr);$i>=0;$i--)
    {
    $newstring.=$strArr[$i]." ";
    }
    echo "New updated String = ".$newstring;

    ?>
     
    ironmankho, Jul 23, 2011 IP