简体   繁体   中英

replace double quotes with single php

我有一个文本类型“test”,我想要“test”,我使用了 str_replace ("" "," '") 但它对我不起作用,因此文本可以在 pdf 中被视为 html

You have to escape the quotes. It won't recognize it otherwise:

$new = str_replace('\'', "\"", $old);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM