Concisely reversing a string by word
<?php $reversed_s = implode(' ',array_reverse(explode(' ',$s))); ?>
1. | Return an array with elements in reverse order | ||
2. | Reversing an Array Using array_reverse() | ||
3. | array_reverse() function reverses the order of the array elements. | ||
4. | Reversing a string by word |