Jump to content


Photo

help with $_SERVER['SERVER_NAME']


  • Please log in to reply
2 replies to this topic

#1 BostonMark

BostonMark
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 May 2006 - 03:03 PM

Hi,

I'm using $baseurl = $_SERVER['SERVER_NAME'] to get the URL on my site. Now I want to have a way to say if anywhere in $baseurl it says "yaddayaddayadda" then ..., else ....

substr is not good because I need to know where to begin for the string to be at. I just want to say is "yaddayaddayadda" anywhere in the String $baseurl

Thanks

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 02 May 2006 - 03:12 PM

Take a look at the [a href=\"http://www.php.net/strpos\" target=\"_blank\"]strpos()[/a] function.

Ken

#3 BostonMark

BostonMark
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 May 2006 - 03:17 PM

Thanks Ken.

I actually just found eregi(), but I also like strpos() as an alternative.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users