Re: parsing a string

From: Date: Wed, 20 Oct 2004 16:49:49 +0000
Subject: Re: parsing a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199905@lists.php.net to get a copy of this message
Dan McCullough wrote:
Hey everyone Having a bit of trouble with something. I have a string which has known patterns. $string"Campus||||||||Bob (Williams)~\\\\\\\\\toms more crap)~\\\\\\\\\blah blah blah)~\\\\\\\\\"; What I am looking for is Location which is Campus
                                      Location Name which is Bob (Williams)
$x = explode('~\\\\\\\\\\\\\\\\\\\\', $string); list($location, $name) = explode('||||||||', $x[0]); Make sure that for each \ in the string, you use \\ (that's why there are 10 in my example. If you have 5 \ you need 5 \\) Greg

« previous php.general (#199905) next »