PHP经典:按字反转字符串

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



相关文章
|
7月前
|
PHP
PHP 字符串
PHP 字符串
25 0
|
1月前
|
JSON JavaScript PHP
PHP把unicode编码的json字符串转中文
PHP把unicode编码的json字符串转中文
13 0