Jump to content

str_replace help using quotation marks within the parameters


victorianrider

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.