簡體   English   中英

str_replace和amp; 不起作用

[英]str_replace with amp; doesn't work

我正在為項目使用php7,嘗試用strreplace替換字符串“ X&Y”,如下所示

$out=str_replace("X amp; Y","other string",$out);

但是該字符串永遠不會被替換,也嘗試使用&符號本身進行嘗試,但是它也不起作用。

嘗試使用

  $out=str_replace("X & Y","other string",$out);

http://www.htmlhelp.com/reference/html40/entities/special.html

符號& & & & & & & & & & & &

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM