使用PHP删除字符串的前4个字符 [英] Remove first 4 characters of a string with PHP

查看:551
本文介绍了使用PHP删除字符串的前4个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用PHP删除字符串的前4个字符?

How can I remove the first 4 characters of a string using PHP?

推荐答案

http://php.net/manual/en/function.substr.php> substr 函数返回从第5个字符开始的子字符串:

You could use the substr function to return a substring starting from the 5th character:

$str = "The quick brown fox jumps over the lazy dog."
$str2 = substr($str, 4); // "quick brown fox jumps over the lazy dog."

这篇关于使用PHP删除字符串的前4个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆