我有字符串'> path1> path2> path3 '
如何通过php删除第一个符号'> '?
答案 0 :(得分:1)
<?php
$string = "> path1 > path2 > path3";
substr($string, 1);
//result will be: path1 > path2 > path3
//This won't remove all the > just the first one.
//if you want to remove all the > Try this:
str_replace('>', '', $string);
//result will be: path1 path2 path3
?>
答案 1 :(得分:0)
答案在这里
<?php
$text=' > path1 > path2 > path3 ';
echo ltrim($text, ' >');
?>
此代码将从左侧删除>符号
您的字符串在>之前有1个空格,因此我使用了[[space]>“