简体   繁体   中英

How to keep null from displaying in internet explorer?

The following is a section of my php page where I am displaying a variable based on weather or not it has a value. This works fine in Firefox and Chrome but in internet explorer "null" is being displayed when the variables have no value rather than just being blank like in FF or Chrome. Is there a way to fix this?

<tr>
 <td>Track</td>
 <td><?php echo $trackResult. '&acute;<br/>';
    if($trackResultOne != NULL){ echo $trackResultOne."&acute;<br/>";}
    if($trackResultTwo != NULL){ echo $trackResultTwo."&acute;";}
    ?></td>
</tr>

Unfortunatelly, you will need to use the ELSE part of the IF to retrieve a blank (''), IE converts automatically the real null into the string 'null'.

Regards,

Pablo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM