替换字符串双引号后引号
问题描述:
我有以下字符串:替换字符串双引号后引号
<something=""Some" random string" somethingelse="Another "random" string">
我需要将其更改为这个
<something=""Some" random string" somethingelse="Another "random" string">
基本上离开“外”引号和改变引号内他们"
我认为一些正则表达式可能被用来做到这一点,但我不知道逻辑应该是什么。任何想法?
答
使用
echo '<something='.chr(34).'Some'.chr(34).' random string" somethingelse="Another "random" string">';
例如:
你可以试试这个:echo chr(34).'Some'.chr(34).' random string';
"Some" random string
+1
你回答什么问题? – Toto
所以你还没有尝试过任何yourseld,没有? – Fallenhero
你应该[在这里看到答案](http://stackoverflow.com/questions/12290882/regex-to-escape-double-quotes-inside-double-quotes-with-preg-replace) –
只是把“你想要你的报价或使用单引号。 – Kornflexx