I am using the following loop to add items to an an array of mine called $liste. I would like to know if it is possible somehow not to add $value to the $liste array if the
Save logic and improve speed by keeping it logic-less. Just keep overwriting.
$list = array(); foreach ($something as $value) { if (!is_object($value) && !is_array($value)) { $list[$value] = $value } } $list = array_values($list);