You could filter by array key:
$testFields = array_filter($_POST, function($key){
return strpos($key, 'test#') === 0;
}, ARRAY_FILTER_USE_KEY);
But I would instead suggest (as written in the comments) that you name your fields "test[]" and iterate over those:
foreach($_POST['test'] as $val){
}
PHP automatically gives you an array of fields with "[]" at the end of their name.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…