İşte ben bakıyorum kodudur.
foreach ($header as $idx => $field) {
if (stripos($field, 'foo') !== false) {
$cols['foo'] = $idx;
} else if (stripos($field, 'bar') !== false) {
$cols['bar'] = $idx;
} else if (stripos($field, 'brr') !== false) {
$cols['brr'] = $idx;
} else if (stripos($field, 'ffo') !== false) {
$cols['ffo'] = $idx;
}
}
Sorry, don't know how to format the code prettily either, any tips on that would be appreciated.
I am looking at some code written by someone much smarter than I, so I am not inclined to trust my first impression to just change everything to if(stripos($foo))
, but why do it this way?