Re: Little question

From: Date: Wed, 09 May 2001 09:23:16 +0000
Subject: Re: Little question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52055@lists.php.net to get a copy of this message
this : if ... $myOra="" ... should be more like : if ... $myOra == "" ... essentially you're setting $myOra as blank everytime which evaluates to true, then it ends up printing the blank, which is not good. regarding typos, this is a common one and since it reveals no error ... it can be frustrating! :) you have others but this is the big one. and for informational purposes : http://php.net/manual/en/control-structures.php http://php.net/manual/en/language.operators.comparison.php regards, philip > > I have this little snippet of code: > > > > > <? > $myOra="MY STRING" > > > <? > if (!(empty($myOra) || $myOra="")){ > ?> > > <br> > > <table width="550" border="0" align="center"> > > <tr bgcolor="ffffff"> > > <td colspan="3"><font > > > > size="2""><b>Orario:</b><?print($myOra)?></font></td> > > </tr> > > </table> > > > <? > } endif > ?> > > > > It should print a little table with the string "MY STRING"... > > ... unfortunately, it doesn't. > > > > Any suggestion???? > > > > BTW: I run this code on the following configuration: > > > > PHP Version: 4.0.4pl1 > > MySQL API version: 3.23.22-beta > > Server API: httpd on a RHLinux 7.1 > > > > Thanks in advance > > > > Gabriele Biondo

« previous php.general (#52055) next »