Is there anyway to improve the below lines of code,
$cnt = 0 ;
$search = array();
foreach($v as $type) {
if (isset($vehicleType[$type]['count'])) {
$cnt = $cnt + $vehicleType[$type]['count'];
} elseif (isset($superStructure[$type]['count'])) {
$cnt = $cnt + $superStructure[$type]['count'];
} else {
$cnt = $cnt + 0;
}
$search[] = urlencode($type);
}
Any help would be greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire