Newbie string question.
What's the best way to check if the incoming variable stored in
getenv("SERVER_NAME")
contains a given string?
We have 3 domians www.domain.com, www.domain2.com and www.domain3.com. I want to check for the presence of domain2 or domain3 in the SERVER_NAME variable and redirect these to domain.com.
I'm planning on using strtolower(); to make sure the comparison is done all in lower case, but I'm not sure how to get around the problem of sometimes the www will be present, other times it won't.
Any help would be greatly appreciated as our ISP appears incapable of doing this trivial task with Virtualhost in Apache.
Chris