My code is finished and i'm trying to optimize it. I was wondering if the following 2 are the same or am I missing something that could potentially cause problems later on?
$this_awardid = !empty($_POST['awardid']) ? $_POST['awardid'] : null; if (empty($this_awardid) ) { ... } elseif (!empty($this_awardid)) { ... } I've optimized the code like so... I'm assuming that $this_awardid it's NOT empty, so there is no need to verify.. Is this logic correct?
if (empty($this_awardid) ) { ... } else { ... }
emptyreturns - true or false. So,elseifis redundant.