PHP经典:按字反转字符串

<?php
error_reporting(0);
$s="cyg&liwen";
$words=explode('&',$s);//去除掉&
$words=array_reverse($words);//反转字数组
$s=implode('&',$words);//重建反转后的字符串
print $s;
?>

在这里插入图片描述

Guess you like

Origin blog.csdn.net/qq_37805832/article/details/120606461