去除斜杠

WBOY
WBOYOriginal
2016-06-23 14:18:301351browse

/Public/Uploads/Photo/  这个该怎么替换成 Public/Uploads/Photo/


回复讨论(解决方案)

substr("/Public/Uploads/Photo/",1,100);

ltrim应该简单些吧?

$str = '/Public/Uploads/Photo/';echo substr($str,1);

ltrim应该简单些吧?
+1

$str = '/Public/Uploads/Photo/';echo ltrim($str,'/');

ltrim($str,'/');
不仅仅是简单!如果原串没有前导的“/”呢,还 substr ?

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