php - How to keep null from displaying in internet explorer?

192

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>
265

Answer

Solution:

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

People are also looking for solutions to the problem: php - how do i change and display results of select counting query when i click on different categories?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.