If statement doesn't seem to work correctly
<p>I may be doing it wrong but take a peek. If I hardcode the logic, it works but not if I try to use it as a variable.</p>

<pre><code>if($range &lt;= 50) {
    $operator = "&lt;=";
} else {
    $operator = "&gt;=";
}

foreach($cursor as $s) {
    $data = round($this-&gt;distance($zip_lat, $zip_lon, $s["lat"],$s["lon"]), 2);

    if ($data .$operator. $range) {
        $zipcodes[] = "$s[zipcode]";   
    }
}               
</code></pre>

<p>I mean, I could add the if/else inside the foreach but wasn't sure if it adds any "overhead."</p>
