So I have the following array:
$ISBN = '0,1,9,8,5,x,8,0,3,0';
$inArray = explode(',',$ISBN);
And I need to find the x
character in it. I'm doing it like so:
foreach ($inArray as $element) {
if (!is_numeric($element)){
$unknown = $element;
echo $unknown;
exit();
}
}
However, what I actually want to do is find the position of the x
character in the array, given that it could be in range of 1 to 10. It's probably something simple that I'm missing.