php code inside $outpu = ""

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

php code inside $outpu = ""

Post by pinehead18 »

Currently my template system has a header which echo's $output in the area which i want it to display. So on my individual pages i have $output = "content";

However i need to put some if statements inside of $output = " ";

How do i put in the if statements $output = " if ($hi == 0) { hello } ?";

I woulnd't think that that script would work, or would it?

Thank you
Anthony
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

why don't you just do this

Code: Select all

<?php

if ($foo=="bar"){
         $content = "foo";
}else{
         $content = "bar";
}

?>
Post Reply