<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<?php
$str = "China is the most beautiful country.";
echo substr($str,-8,3)."<br>";
echo strstr($str,"mo",true)."<br>";
echo strpos($str,"mo")."<br>";
$str = "China is the most beautiful country.";
echo str_replace('China','American',$str)."<br>";
echo str_replace(['China','is','most'],['American','are','best'],$str)."<br>";
echo substr_replace($str,'***',6)."<br>";
echo "<hr>";
$str1="http://www.baidu.com";
echo urlencode($str1)."<br>";
echo urldecode($str1)."<br>";
$array = ["语文","数学","英语"];
echo json_encode($array)."<br>";
?>
</body>
</html>
本章讲解的都是常用的小知识点,应该多看几遍,熟记熟用@!