<?php

    $str = "Hello World";
    echo strrev($str);

?>

http://ie2.php.net/strrev

Regards


"Kristian Rasmussen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I need a script for reversing a string ("hello world" becomes "dlrow
> olleh"). I have tried the following:
>
> ---
> $length = strlen($i);
> $g = "";
>
> while ($length > 0)
> {
>    $g = $i[$length] . $g;
>   $length--;
> }
> echo $g;
> ---
>
> With, obviously, no success. Is this the way or could array_reverse()
> somehow be used?
>
> Kristian

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to