Its syntax is: string strstr (string string, string occurrence) <? $url = "http://www.java2java.com"; $domain = strstr($url, "."); print $domain; ?>