I\'m a complete newbie to PHP but found it can be very useful. How can I write the following statement in PHP:
If body ID = \"home\" then insert some html, e.g.
You can try using this :
$html = ''; if ( $body_id === 'home' ) { $html .= 'I am home!'; } else { $html .= 'I\'m not home.'; } echo $html;
I\'m not home.
This will echo the html code depending on the $body_id variable and what it contains.