note 86191 added to function.array-slice

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
I tried the arem function provided below and found that when the keys are numeric, a slight modification needs to be made to keep the returned array indices continuous.  Here's my update:
#Remove an element from an array and return the result
function arem($array,$value){
    $holding=array();
    foreach($array as $k => $v){
        if($value!==$v){ //when comparing strings, !== is appropriate here instead of !=
            $holding[]=$v; //removed the key so continuous indexes are preserved.  Put $k back in if the keys need to be preserved.
        }
    }   
    return $holding;
}
----
Server IP: 64.71.164.2
Probable Submitter: 75.131.167.255
----
Manual Page -- http://www.php.net/manual/en/function.array-slice.php
Edit        -- https://master.php.net/note/edit/86191
Del: integrated  -- https://master.php.net/note/delete/86191/integrated
Del: useless     -- https://master.php.net/note/delete/86191/useless
Del: bad code    -- https://master.php.net/note/delete/86191/bad+code
Del: spam        -- https://master.php.net/note/delete/86191/spam
Del: non-english -- https://master.php.net/note/delete/86191/non-english
Del: in docs     -- https://master.php.net/note/delete/86191/in+docs
Del: other reasons-- https://master.php.net/note/delete/86191
Reject      -- https://master.php.net/note/reject/86191
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.