开发者

php remove specified characters in a given string using "preg_replace()"

How to re开发者_JAVA技巧move the specific characters in a string(strip the "http://www." from a string)

For example, my string is like this: http://www.hooeeywebprint.com


You can try this one

var_dump(preg_replace("/^[^\.]*\.(.*)/", "\\1", "http://www.example.com"));

which removes everything from string up to first . character, including it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜