In prose, which is:
- First translate the string into an array of words
$ words = explode ('', $ string);
- Secondly, we invert the order of elements in this array
$ reverseed_string = implode ('', array_reverse ($ words));
Reading the entire list of string and array functions in PHP is VERY useful and will save a ton of time.
source
share