I'm a longtime CF programmer who is just learning PHP. I'm very excited about too.
Here's my question. Is there a way to have an if statement in the middle of an echo statement? I just want to display a nbsp if the array index is empty. In CF I'd do this:
How do I do this in PHP? Right now, I just have that logic separated out before the TD output where I say:
This works, but is it the best way?
Kevin
slanek@ssd.fsi.com
"Life is what happens to you while you're busy making other plans."
- John Lennon
Here's my question. Is there a way to have an if statement in the middle of an echo statement? I just want to display a nbsp if the array index is empty. In CF I'd do this:
Code:
<TD>#IIf( myArray[ x ] IS "", DE( " " ), "myArray[ x ] )#</TD>
How do I do this in PHP? Right now, I just have that logic separated out before the TD output where I say:
Code:
if ( $myArray[ x ] == "" )
$myVar = " ";
else
$myVar = $myArray[ x ];
This works, but is it the best way?
Kevin
slanek@ssd.fsi.com
"Life is what happens to you while you're busy making other plans."
- John Lennon