Explode and get a value in one line of code
As an alternative to list(), you may use array_shift()
$foo = array_shift(explode(':', $foo));
Yes, it's posible to do using list
:
list($foo) = explode(":", $foo);
you could use stristr for this:
$foo = stristr($foo,":",true);
where true sets it to give you everything before the first instance of ":"