0

I'm having trouble with href quotes inside the fwrite. What I have no is something like this:

fwrite($fp, "Some text ".$SomeVar." some text :".$SomeVar.". Some text <a href="https://www.google.com/" target="_blank"><br>Some text <a href="https://www.google.com/" target="_blank">");

Is there any way to make those href quotes mark as plain text?

I have read somewhere that using double quotes might help, but it doesn't. I have also tried:
<a href="https://www.google.com/\" target="_blank\">

Thank you.

Maredha
  • 3
  • 3

1 Answers1

2

It's easier to use single quotes when your string contains double quotes:

$string = '<a href="https://cia.gov">CIA</a>';

Or, you can escape the quotes like this:

$string = "<a href=\"https://cia.gov\">CIA</a>";
delboy1978uk
  • 12,118
  • 2
  • 21
  • 39