djfox Posted December 29, 2007 Share Posted December 29, 2007 I have the following sting: <br>Msn: <b><? echo $user[8]; ?></b> If $user[8] is empty, I want that entire string to just not show up. But if $user[8] does have something, I want that string to be visible. How do I make that happen? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 29, 2007 Share Posted December 29, 2007 <?php if ($user[8]) { echo "<br>Msn: <b>$user[8]</b>"; } ?> Quote Link to comment Share on other sites More sharing options...
djfox Posted December 29, 2007 Author Share Posted December 29, 2007 Thanks very much! Quote Link to comment Share on other sites More sharing options...
redarrow Posted December 29, 2007 Share Posted December 29, 2007 playing with ur code lol.......... <?php $user[8]="redarrow"; if ($user[8]) { $x=$user[8]; $x="User $x there!"; }else{ $x="user not there"; } echo "<br>Msn: <b>$x</b>"; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.