Re: [PHP] pulling data out of a string

2001-05-24 Thread Dan Lowe
Previously, Richard Kurth said: That my problem www is not always the host when it is a sub-domain it would be like mysit.domain.net or sometimes people put a few extra periods in the domain name like www.my.test.net I thought maybe I could look at the string and find out how many periods

Re: [PHP] pulling data out of a string

2001-05-15 Thread Chris Lee
this will remove the www plus the top level domain ?php $site = 'www.somesite.home.com'; $site = str_replace('www.', '', $site); $site = explode('.', $site); $site = array_pop($site); $site = implode('.', $site); // somesite.home ? this will remove the first host and the top level

[PHP] pulling data out of a string

2001-05-14 Thread Richard Kurth
I am trying to figure out how to pull data out of a string. This is driving me crazy. I figure an if statement of some sort would work but I'm not sure how to structure it. I know how to get what I want if it is just $fullhostname = www.domain.net; $exp = explode(., $fullhostname); $host =

Re[2]: [PHP] pulling data out of a string

2001-05-14 Thread Richard Kurth
Hello Philip, Monday, May 14, 2001, 3:36:17 PM, you wrote: That my problem www is not always the host when it is a sub-domain it would be like mysit.domain.net or sometimes people put a few extra periods in the domain name like www.my.test.net I thought maybe I could look at the string and