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.
对于像这样的字符串:
""abc"""
它应该是:
"abc"
但是我的尝试失败了:
preg_replace('/[\"]+/','"',$input);
这似乎工作......
$input = '""abs"""'; //$input = '""abs""'; //$input = '"abs"""'; //$input = '""abs""'; $input = preg_replace('/"+/','"',$input); echo $input;
正则表达式的简短解释 -
"
+
我的回答建立在@joey之前的回答的基础上,该回答已被删除......
参考 -