反序的应用,主要是strrev() 以及 array_reverse的应用,当然还有explode和join.
直接上代码
<?php
/**
* reverse using
*
*
*/
$word = "just test";
echo strrev($word);
$s = "Once upon a time there was a turtle.";
$words = explode(" ", $s);
$words = array_reverse($words);
$s = join(" ", $words);
echo $s;
// $reversed_s = join(" ", array_reverse(" ", $s));
?>再次声明,写这个的目的不是技术,而是有时候用到的时候方便查询。并不是什么高深的技术。对于大神来说太基础。不过感觉还是很有用。。
本文介绍PHP中实现字符串及数组反序的方法,包括使用strrev()函数反转字符串,利用array_reverse()反转数组,并通过实例展示具体操作过程。
6312

被折叠的 条评论
为什么被折叠?



