简单教程
提交运行
代码编辑器:
<?php echo substr("Hello world",0,10), "<br>"; echo substr("Hello world",1,8), "<br>"; echo substr("Hello world",0,5), "<br>"; echo substr("Hello world",6,6) , "<br>"; echo substr("Hello world",0,-1), "<br>"; echo substr("Hello world",-10,-2), "<br>"; echo substr("Hello world",0,-6), "<br>"; echo substr("Hello world",-2-3), "<br>";
运行结果: