[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()
somehow be used?

Kristian

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



[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()
somehow be used?

Kristian

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