- substr: documentation ( source)
<?php
$_POST['checkbox_1'] = '';
$_POST['checkbox_11'] = 'ssa';
$_POST['checkbox_12'] = 'ssa';
$_POST['checkbox_30'] = '';
//$_POST['checkbox_13'];
foreach($_POST as $key=>$val){
if(substr($key, 0, 9 ) != 'checkbox_') continue;
if($val){
echo (int)substr($key, 9 )." ";
}
}