如何正确地替换\“或从字符串中删除这些字符?它们必须放在一起,而不是分开
$string = '{"ID":"89t9ZUIx1Mt","Title":"Pen","Attribution":"\"Pen\" by Jarlan Perez, https://poly.pizza/m/89t9ZUIx1Mt. Licence at https://creativecommons.org/licenses/by/3.0"';
$replaced = str_replace("\"\\", "",$string);
echo $replaced;
结果:{"ID":"89t9ZUIx1Mt","Title":"Pen","Attribution":"Pen\" by Jarlan Perez, https://poly.pizza/m/89t9ZUIx1Mt. Licence at https://creativecommons.org/licenses/by/3.0"
目标:
{"ID":"89t9ZUIx1Mt","Title":"Pen","Attribution":"Pen by Jarlan Perez, https://poly.pizza/m/89t9ZUIx1Mt. Licence at https://creativecommons.org/licenses/by/3.0"
1条答案
按热度按时间bvhaajcl1#
最终解决方案