PHP if/else alternative HTML code
PHP is so direct and simple that allows with just some instructions to create dynamic pages mainly using HTML code. We are referring to HTML pages with some simply php instructions changing content upon conditions verification..

The HTML page in the example here below welcomes the user with a sentence based on the time. We are using the date() function that returns information about date and time (and in our case, with the 'a' string parameter, the am or pm statement is returned).
Welcome to

<?php if (date("a")=="am") : ?>
good morning<br>
did you just wake up???

<?php else: ?>
good afternoon<br>
(or good evening)

<?php endif ?>

Thanks for having chosen our site
Last Updated ( sabato, 01 dicembre 2007 )