PHP tutorial for a perl programmer

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Fri Nov 10 14:21:57 UTC 2006


On Fri, Nov 10, 2006 at 09:16:38AM -0500, Lennart Sorensen wrote:
> You can simply jump in and out of code mode from html (the default mode)
> at any time with the <?php / ?> tags.  I didn't actually run any of
> these examples, but php code is almost never wrong... :)

Something else handy in php that may not be obvious that you can do is:

<?
$state = 1;
?>
<HTML>
<TITLE>Some page</TITLE>
<BODY>
<? if($state) { ?>
This is the content of my page.
<? } else { ?>
This is the alternate content of my page
<? } ?>
</BODY>
</HTML>

--
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list