Re: Out of the box algorithms
| From: | Wolfram Kriesing | Date: | Wed, 06 Feb 2002 10:11:27 +0000 |
| Subject: | Re: Out of the box algorithms | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-83689@lists.php.net to get a copy of this message | ||
> users: username "username with spaces" anotherusername
>
> I need to parse that into a structure like
> $users = array(
> 'username',
> 'username with spaces',
> 'anotherusername'
> );
try preg_match
i think the expression could look something like this:
'/users:\s*(^\s+)"(.*)"\s*(.*)\n/'
this should let you get
'username' in $1
'username with spaces' in $2
'anotherusername' in $3
i didnt test it, but it could work :-)
--
Wolfram