数组分隔输出数据

one other question

$_SESSION['files'][] = $sid . '-' . $data['Id'] . '-reg'
$_SESSION['files'][] = $sid . '-' . $data['Id'] . '-nor'
...

the files session should look like this when echoed

317e2b5a2376dd19cb5fc431bced949a-56-reg

how do i take $_SESSION['files'][] and separate the data into these variable $sid, $id, $type using - and the separator... something like this.

$sid = "317e2b5a2376dd19cb5fc431bced949a";
$id = "56";
$type = "reg";

following codaddict below example something like this would be right correct?

for($i=0;$i<count($_SESSION['files']);$i++) {
list($sid,$id,$type) = explode('-',$_SESSION['files'][$i]);
...
}

You can use explode:

list($sid, $id, $type) = explode('-', $filename, 3);

Or sscanf:

sscanf($filename, '%s-%s-%s', $sid, $id, $type);

You can use explode function as:

list($sid,$id,$type) = explode('-',$_SESSION['files'][$index]);

Ideone link