string strstr ( string haystack, string needle ) finds the first occurrence of a substring inside another string (parameter one)
<? $string = "http://www.example.com/mypage.php"; $newstring = strstr($string, "www"); ?>