$v = "1s1c4m1";
$z = array_map(create_function('$a,$b','return $b.$a;'), preg_split('/s|c|m/',$v), array('','s','c','m'));
$id = current($z);
$size = next($z);
$color = next($z);
$m = next($z);
printf('id: %s; size:%s; color:%s; m:%s', $id, $size, $color, $m);