Home  >  Article  >  Backend Development  >  怎的清除指定字符前的所有字符串

怎的清除指定字符前的所有字符串

WBOY
WBOYOriginal
2016-06-13 12:36:371328browse

怎样清除指定字符前的所有字符串?
字符串如下,我想清除vid=及之前的字符,也就是只保留198445623。这其中只有vid=是固定的字符。
http://ooioosy.wwowo9e.com/owuiwd/vid=198445623

我现在的方法是这样的,通过计算vid=的位置来清除,有没有更节省系统资源的方法?
$vid = "http://ooioosy.wwowo9e.com/owuiwd/vid=198445623"
substr($vid,(stripos($vid,'vid=')+4));

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn