Question
php + should I use is_null or !empty
Hi I read in another topic in this forum that if they were
wanting to show a link if available that they used:
<?php
if ( is_null($row_rsMyRecordset['event_link']) ) {
echo $row_rsMyRecordset['event_text'];
} else {
echo "<a
href=".$row_rsMyRecordset['event_link'].">".$row_rsMyRecordset['event_text']."</a>";
}
?>
I have used this and it works on my local server, but I read the php manual and wanting to follow correct methods of use:
if (!empty($row_blah['email'])) echo 'Email Us';
I hadn't heard of using is_null before so this is why I am wondering the best method.
Thanks for your time.
<?php
if ( is_null($row_rsMyRecordset['event_link']) ) {
echo $row_rsMyRecordset['event_text'];
} else {
echo "<a
href=".$row_rsMyRecordset['event_link'].">".$row_rsMyRecordset['event_text']."</a>";
}
?>
I have used this and it works on my local server, but I read the php manual and wanting to follow correct methods of use:
if (!empty($row_blah['email'])) echo 'Email Us';
I hadn't heard of using is_null before so this is why I am wondering the best method.
Thanks for your time.