I want to get the text and print every words backwards.
Example: Hello World
Output: World hello
This is my codes so far. It is different, I get output backwards but per string.
$string = "hello world";
$length = strlen($string);
for ($i=($length-1) ; $i >= 0 ; $i--)
{
echo $string[$i];
}
Output of the above code is:
dlrow olleh