I have a status report database table named dsr
and it has some indexes named as nlanestatus1, nlanestatus2 ... so on and slanestatus1, slanestatus2 ... and so on ..
I ve been trying to filter these values by
$array = array_filter($dsr, function($key) {
return strpos($key, 'lanestatus') === 0;
}, ARRAY_FILTER_USE_KEY);
I took this code from another question on stackoverflow, and understood that by changing the value of 0 to 1 in function($key), I can get the required keys, after experimentation with this code however, i found out that this function does not work. I tried changing the 3 equals to 2 equals and it just displays the whole $dsr array. Any help in php coding would be helpful.
Another method to solve it would be to change the mysql indexes but the system is already in working and changing them can break it so its not an option.