RE: [PHP] if then statement

From: Date: Tue, 22 Apr 2003 02:17:18 +0000
Subject: RE: [PHP] if then statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144749@lists.php.net to get a copy of this message
> for the life of me I cannot figure out how to do the following: > (below not correct syntax, just the idea) > > If x == 1 then > show something > else > show this > end > > Now I don't want it all in one PHP script. I need it so that in > dreamweaver, when I open the document, I see the opening IF PHP tag then > my > text of "show something", then the ELSE tag, my text of "show this", then > the END tag. Now I can do this with asp(which I'm familiar with), but I > am > having difficulties trying to figure out a similar way in php. Any ideas? <? If($x==1) { ?> show something <? } else { ?> show this <? } ?> ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#144749) next »