If Condition Is Met, Show Content
PHP<?php // Checks to see if the URL contains the text string // and if it does, it writes the HTML code to the page if( stristr($_SERVER['PHP_SELF'], '/foo/bar/1/') == TRUE ) <?php { ?> <!--Your HTML Content Goes Here--> <?php } ?>
Show content only when a condition is met. This can be teamed up with other conditions to include one sidebar.php file with all of your secondary navigation, and then show the proper navigation on a certain page. The code above also makes it easier to add HTML between PHP without the need for echo ' '
Source: http://php.net/manual/en/control-structures.elseif.php




