<?php
echo "I'm currently listening to</a> <a href='http://last.fm/artist/" . str_replace(" ","+",$artist) . "/_/" . str_replace(" ","+",$currenttrack) . "'>" . $currenttrack . "</a>";
?>
以上是我的代碼。我想在$artist
和$currenttrack
像再次使用str_replace()
:我可以在一個字符串中使用str_replace兩次嗎?
str_replace("'","%27",$artist)
和str_replace("'","%27",$currenttrack)
,因爲那一撇不經過正確和我的代碼混亂,但是當我的空間首先使用它,它已經通過,不會再改變。
我該怎麼辦?
+1 ..不知道爲什麼有人低估了這個答案,這是唯一一個使用str_replace – 2014-09-20 19:48:53
實際解決問題的人謝謝。現在試試這個。 – Cody 2014-09-20 20:36:51
這工作,謝謝你一噸! – Cody 2014-09-20 20:39:56