Chinese and English string flip function_PHP tutorial

WBOY
Release: 2016-07-21 15:48:32
Original
1169 people have browsed it

Copy code The code is as follows:

//Set page encoding to utf8
header ('Content-type: text/html; charset=utf-8');
$luokuan = "ABCDEFG-tested-!!! One, two, three, four, five...";
$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;
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319701.htmlTechArticleCopy the code as follows: ?php //Set the page encoding to utf8 header('Content-type: text/html ; charset=utf-8'); $luokuan = "ABCDEFG-tested-!!! One, two, three, four, five..."; $n = mb_strle...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!