Re: array issues
| From: | Matt Carlson | Date: | Mon, 26 Feb 2007 15:56:40 +0000 |
| Subject: | Re: array issues | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-249456@lists.php.net to get a copy of this message | ||
If i'm understanding you correctly, you have something like a flat file, and hopefully it is
artist[tab]artist[tab] with the title being something like artist1title[tab]artist2title[tab], etc.
If so, use explode.
$artists = explode("\t", $stringofartists);
$songs = explode("\t", $stringoftitles);
$i = 0;
foreach($artists as $key)
{
$information[$key] = $songs[$i];
$i++;
}
I hope this is kind of what you were looking for.
[snip]
Artist[tab]artist[tab]artist[tab] etc as a entry for "artists"
[/snip]