Get first value of comma separated string
list($first) = explode(',', 'a,b,c,d');
var_dump($first); // a
probably works :)
In PHP 6.0 you will be able to simply:
$first = explode(',', 'a,b,c,d')[0];
But this is a syntax error in 5.x and lower
How about
echo reset(explode(',', 'a,b,c,d'))
Steve
It's little bit shorter
strtok('a,b,c,d', ",")