<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
$str = ('这样一来我的字符串就不会有乱码^_^');
echo substr($str,3)."<br>";//按字符
echo mb_substr($str, 0, 7, 'utf-8')."<br>";//按字
echo mb_strcut($str, 0, 3, 'utf-8');//按字节
?>
</body>
</html>