时间:2021-07-01 10:21:17 帮助过:13人阅读
php的substr函数功能非常强大,不断可以从前往后去子字符串还可以从后往前取字符串
<?php $string = "beginning"; print("Position counted from left: ".substr($string,0,5)."\n"); print("Position counted form right: ".substr($string,-7,3)."\n"); ?>
输出结果:
Position counted from left: begin Position counted form right: gin
希望本文所述对大家的php程序设计有所帮助。