Jump to content

Recommended Posts

should be simple..right?? well, for some reason I can't figure this out, not sure what to google either!

 

in most cases, I have no problem with if/else commands,

but what if the variable is NULL, but

 

if($image === "NULL")

 

but NULL doesn't work

 

neither does if($image === " ")

or

if($image > NULL)

 

etc., etc.

 

 

it's a image from a API,

if there is not a image (image url)

then display nothing

if there is, display the image

 

Does anyone know of any other code that may help??

 

 

here's what the XML file looks like when there is no image

 

<ReferencesCount>49</ReferencesCount>

<ImageUrl/>

<FirstName>John</FirstName>

 

and what it looks like if there is a image

 

<ReferencesCount>186</ReferencesCount>

<ImageUrl>

http://www.zoominfo.com/Search/PersonImage.aspx?DefaultImageSource=http://www.zoominfo.com/images/transparent.gif&AccountID=5108&ImageSource=http://www.zoominfo.com/About/i/photo_yonatan.jpg

</ImageUrl>

<FirstName>Jonathan</FirstName>

 

 

SEE what's missing?? (it's from the zoomInfo.com API)

 

and here is the problem with the images

i-locate.info/zoom.php

 

thanks for any help any one can give!!

 

 

Link to comment
https://forums.phpfreaks.com/topic/143872-ifelse-help/
Share on other sites

in most cases, I have no problem with if/else commands,

but what if the variable is NULL, but

 

if($image === "NULL")

 

but NULL doesn't work

 

neither does if($image === " ")

or

if($image > NULL)

 

Well, first you're using the exact comparison, when really a normal comparison (==) would do fine. Next, "NULL" shuld be NULL, without quotes. Finally, why not just use the is_null() function?

Link to comment
https://forums.phpfreaks.com/topic/143872-ifelse-help/#findComment-755047
Share on other sites

Thanks for the response, yes, I tried  if($image === "NULL") ,  if($image === NULL ) ,  if($image === 'NULL') ,  if($image > 1) ,  if($image === 1) , etc, etc, etc...

 

and the is_null()  didn't work either.. I read this entire page http://us2.php.net/is_null 3 times and tried several examples, nothing... any other ideas!???

Link to comment
https://forums.phpfreaks.com/topic/143872-ifelse-help/#findComment-755181
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.