[PHP] Reversing a string?

2004-05-13 Thread Kristian Rasmussen
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()

[PHP] Reversing a string?

2004-05-13 Thread Kristian Rasmussen
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()