Re: PHP double quotes inside double quotes
"MSB" <ajhfdsa@adf.com> wrote in message
news:e45ef$45381d91$d8600654$7726@ALLTEL.NET...
>I am trying to figure out how to do double quotes inside double quotes
>
> $newcode = str_replace("<a", "<a target=_blank", $newcode);
>
> $newcode = str_replace("<a", "<a target="_blank"", $newcode);
>
> the code works as is in the first example...but it screws up my validation
> when it is parsed
>
I bypass this problem, (and the quote character, "\"), by using single
quotes. This works for me:
$newcode = str_replace(' "<a", "<a target=_blank" ' , $newcode);
(Note: I have put a space between the single and double quotes here ONLY
for clarity for you to see what I mean. In the actual code I do not have
any space.
Shelly
|