Monday, March 31, 2008

learning

i read something about PHP. when PHP parse a file, it looks for opening tag and closing tag. these two tags tell PHP where to start and stop interpreting the code between them. the opening tag and closing tag could write like<?php ?>,<script language="php"></script>,<? ?>,<? ?>

but in this program:
<?php
if ($expression) {
?>
<strong>This is true.</strong>
<?php
} else {
?>
<strong>This is false.</strong>
<?php
}
?>
i get a little bit confussed. why the PHP starting tag and closing tag are put beside "if ($expression)", "else", and "}". anyone get idea about this plese leave message to me, thanks.

No comments: