Re: removing an array element

From: Date: Fri, 11 Jan 2002 22:37:49 +0000
Subject: Re: removing an array element
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-80251@lists.php.net to get a copy of this message
Because, as a dope, I forget that you can invert IF statements like that -- you're right, I'd rather do that than mess with the array. Although the feedback on unset($arrayname['index']) was extremely useful knowledge! Thank you everyone. Erik On Friday, January 11, 2002, at 12:31 PM, Rasmus Lerdorf wrote:
Why not just add a simple check inside that while loop? if($temprow['div_id'] != $home_div_id)
      echo "<option value=\"" . $temprow['div_id']
          . "\">" . $temprow['div_name'] . "</option>\n";
Seems more logical to me than to mess with the array itself. -Rasmus


« previous php.general (#80251) next »