- var_dump: documentation ( source)
- array_shift: documentation ( source)
- explode: documentation ( source)
<?php
$tests = array(
'test1',
't1;t2;t3',
'',
null,
);
foreach ( $tests as $i => $str ) {
var_dump(array_shift(explode(';',$str)));
}