explode a string

From: Date: Mon, 18 Apr 2005 11:34:33 +0000
Subject: explode a string
Groups: php.general 
Request: Send a blank email to php-general+get-213260@lists.php.net to get a copy of this message
$string = '4:gaming,5:hardware,3:software,8:security'; what is the best way to explode then loop this string after its taken apart. output should be something like: $id = 4 $cat = gaming etc.. im just looking for the best/fastest way to do this. the string can grow to 200 or so bytes, maybe more. should i list(), while(), explode it, or should i explode it and foreach it? or..? thanks.

« previous php.general (#213260) next »