Re: parsing a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux