Richard Kurth wrote: > I know how to get last part of a string out of a string > But how do I get the first part before the needle On the example > below I just what domain > > $hostdomain= domain.com > > $host = substr (strrchr ($hostdomain, "."), 1); strrchr (two r) finds the first occurence from the end of the string strchr (one r) finds the first occurence from the beginning of the string > echo $host; com > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]