PHP string reversed by Word method, PHP string Word reversal
The example in this article describes how PHP strings are reversed by word. Share to everyone for your reference. The specific analysis is as follows:
The following PHP code can reverse the output of a string according to the word, in fact the city now separates the string into the array by space, then inverts the output to the group
<?php$s = "Reversing a string by word";//Break the string up into words$words = explode (", $s);//reverse the array o F words$words = Array_reverse ($words);//rebuild the String$s = Implode (", $words);p rint $s;? >
The output results are as follows:
Word by string a reversing
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/967733.html www.bkjia.com true http://www.bkjia.com/PHPjc/967733.html techarticle PHP string Inversion by Word method, PHP string Word reversal This article describes the PHP string by word reversal method. Share to everyone for your reference. Specific points ...