0

i use an if function to display copy but this copy has to be wrapped in double quotes, and i cant get it working. any help please.

Code

 $currentpage = $_SERVER['REQUEST_URI'];

if ($currentpage == "/room/penthouse-suite/"){
echo "<div class='text-center text-emphasis text-lg'>"test penthouse"</div>";
}

so on my page it should display ---> "test penthouse"

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Ylama
  • 2,449
  • 2
  • 25
  • 50

1 Answers1

5

You can simply escape the characters by using a backslash.

$currentpage = $_SERVER['REQUEST_URI'];

if ($currentpage == "/room/penthouse-suite/"){
    echo "<div class='text-center text-emphasis text-lg'>\"test penthouse\"</div>";
}
Ian
  • 3,539
  • 4
  • 27
  • 48