1 2 3 4 5 6 7 8 9
<?php $arr = array(0,1,'test',2,3); foreach($arr as $i=>$el){ if($el == 'test') echo 'test, '; else echo $i.', '; }
1
test, 1, test, 3, 4,