Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串
$string;
在这个字符串中我有一个数字,比如3743687
3743687
我希望在每个数字之后添加一个斜杠,除了最后,所以结果将是
3/7/4/3/6/8/7
有没有一个php函数可以做到这一点,对吗?有什么建议吗?谢谢
$string = '3743687'; $newString = implode('/',str_split($string)); var_dump($newString);
$string = "3743687"; $string = implode("/", str_split($string)); echo $string;