Home > php教程 > php手册 > 中英文字符串翻转函数

中英文字符串翻转函数

WBOY
Release: 2016-06-13 12:25:48
Original
1259 people have browsed it

复制代码 代码如下:


//页面编码设为utf8
header('Content-type: text/html; charset=utf-8');
$luokuan = "ABCDEFG-测试的啊-!!!一二三四五。。";
$n = mb_strlen("$luokuan","UTF-8");
//echo $n;
$newluokuan = "";
for ($i=$n;$i>=0;$i--)
{

$newluokuan.= mb_substr($luokuan,$i,1,'UTF-8');

}
echo $newluokuan;
?>

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template