7

I want to concatenate in the middle of an echo to write an if statement, is this possible? Here is what I have.

echo "<li class='".if ($_GET["p"] == "home") { echo "active"; }."'><a href='#'>Home</a>        </li>";
Necro.
  • 987
  • 6
  • 17
  • 29
  • Why am I getting voted down?...What about this question isn't defined? – Necro. Nov 26 '12 at 20:01
  • I didn't do it but I guess it's because it's something you could have found the answer to by googling. – Popnoodles Nov 26 '12 at 20:01
  • Well I came where I trust peoples opinion. Thats not cool lol. – Necro. Nov 26 '12 at 20:02
  • echo is a language construct. it is not a function and has no return value that you could concatenate. – Marc B Nov 26 '12 at 20:10