victorianrider Posted November 5, 2010 Share Posted November 5, 2010 Hi, I am somewhat new to PHP but I have a little experience. I am having trouble coding this script to set variables with extra quotations and replacing some exploded strings. Here is the script. <?php $ToCutDown = "[{"parentMessageId":-1,"message":"%3Ca%20href%3D%27%23%27%20class%3D%27standardLink%27%20onclick%3D%27showMobStats%28674542538%29%3B%27%3Eaka%20Bubbles%3C%2Fa%3E%20broadcast%20a%20message%3A%20%3Cfont%20color%3D%27red%27%3E%22Place%20Bounty%20on%20%26quot%3Baka%20Bubbles%26quot%3B%20%28Minimum%20of%20%2418%2C107%2C899%2C000%29%22%3C%2Ffont%3E%2E","id":28152301,""; $Exploded = explode("[{"parentMessageId":-1,"message":"", $ToCutDown); $Exploded = explode(","id":28152301,"", $Exploded[0]); $Exploded = urldecode($Exploded[1]); $StringReplace = str_replace("<a href='#' class='standardLink' onclick='showMobStats(674542538);'>", "", $Exploded); ?> So I'm trying to work with specific strings that have quotation marks in them (Which cannot be removed) & I'm having a hard time using them in variables and in any function that requires you to choose parameters with either ' ' or " ". Any suggestions would be appreciated thanks MOD EDIT: . . . tags added. Link to comment https://forums.phpfreaks.com/topic/217843-str_replace-help-using-quotation-marks-within-the-parameters/ Share on other sites More sharing options...
rwwd Posted November 5, 2010 Share Posted November 5, 2010 I believe that you escape them with \" or /" i can never remember which it is. Rw Link to comment https://forums.phpfreaks.com/topic/217843-str_replace-help-using-quotation-marks-within-the-parameters/#findComment-1130639 Share on other sites More sharing options...
victorianrider Posted November 5, 2010 Author Share Posted November 5, 2010 I believe that you escape them with \" or /" i can never remember which it is. Rw I tried both but couldn't get it working, could you show me how you would implement those into my code? Thanks Link to comment https://forums.phpfreaks.com/topic/217843-str_replace-help-using-quotation-marks-within-the-parameters/#findComment-1130649 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.