去除斜杠

WBOY
Release: 2016-06-23 14:18:30
Original
1335 people have browsed it

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


回复讨论(解决方案)

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

ltrim应该简单些吧?

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

ltrim应该简单些吧?
+1

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template