<?php $test = 'test'; $arr = ['test','test2', 'test3', 'test4']; $found = []; if(false !== $key = !array_search($test, $arr)){ $found[] = $key; } print_r($found);
You have javascript disabled. You will not be able to edit any code.