I have a problem with the output of array_search, with this code, I have to search different ids ($progId) that are located in the column 0 of the multidimentional array $progInLvl . However it wont return a positive result when searching for integer 1, while 2 or 3 are working well.
Do you know where this could be coming from?
Cheers
$progInLvl = [[1, "a", "aaaa"], [2,"b", "bbbb"], [3, "c", "cccc"]];
$progId = 1;
$newArr = array_column($progInLvl, 0);
if (!array_search($progId, $newArr)){
$progId = "fail";
}
echo $progId;