if this domain name dont show it!

Hi all,

My programer is away on holiday and I really need to get this sorted so if anyone can help I would be very graitfull :)

I have this snipit

$images[] = '<div style="padding-bottom: 10px;"><a href="'.site_url('Insure_Car_Insurance').'"><img src="/public/images/insureleft.gif" alt="Car Insurance" border="0"></a></div>';

Now what I need to do is, if the site domain name is http://www.domainname.com do not show this image, but please show it to any other domain.

Please can anyone help

Thanks Paul
submissiontechnologyAsked:
Who is Participating?
 
majkiwConnect With a Mentor Commented:
You can test that using strpos($haystack, $needle), which returns index of needle in haystack. If not found -1 is returned.
So you can just write:


if(strpos(site_url('Insure_Car_Insurance'), 'http://www.domainname.com') == -1 ){
  $images[] = '<div style="padding-bottom: 10px;"><a href="'.site_url('Insure_Car_Insurance').'"><img src="/public/images/insureleft.gif" alt="Car Insurance" border="0"></a></div>';
}
else 
  $images[] = '';

Open in new window

0
 
majkiwCommented:
So, did it work for you or isn't it what you needed?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.