note 22113 modified in function.array-splice by vrana

From: Date: Tue, 17 Aug 2004 14:49:58 +0000
Subject: note 22113 modified in function.array-splice by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79903@lists.php.net to get a copy of this message
Aiya, I feel silly. The fix for my code above assumes that your values in the associative array are strings. Ignore the fix code in my last post and use this instead: <?php if(is_array($replacement)) foreach($replacement as $r_key=>$r_value) $new_array[$r_key]=$r_value; elseif($replacement!==NULL) $new_array[$key]=$replacement; ?> Sorry again. I feel sheepish. n.n --was-- Aiya, I feel silly. The fix for my code above assumes that your values in the associative array are strings. Ignore the fix code in my last post and use this instead: if(is_array($replacement)) foreach($replacement as $r_key=>$r_value) $new_array[$r_key]=$r_value; elseif($replacement!==NULL) $new_array[$key]=$replacement; Sorry again. I feel sheepish. n.n http://php.net/manual/en/function.array-splice.php

« previous php.notes (#79903) next »