RE: [PHP] Explode a string
| From: | Chris W. Parker | Date: | Wed, 12 Nov 2003 17:19:06 +0000 |
| Subject: | RE: [PHP] Explode a string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-169314@lists.php.net to get a copy of this message | ||
Erin <mailto:xp@cookra.co.uk>
on Wednesday, November 12, 2003 9:13 AM said:
> 734088+3+734132+9+734138+80+781007+1+
>
> I need to place the string into a multi-array like so
>
> array[0][0] = 734088
> array[0][1] = 3
[snip]
> Now ive tried everything i know any ideas?
Yes. You need to somehow differentiate between the different columns and
rows. What I suggest you do is change every other + to something else
like a ; and then split on that.
Without knowing any other way to do this I would use a regex to skip the
first + and change second one, repeating this until the end of the
string.
Then you can explode() on + and ;.
hth,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/