note 117119 added to function.array-unshift

From: Date: Fri, 17 Apr 2015 08:18:55 +0000
Subject: note 117119 added to function.array-unshift
Groups: php.notes 
Request: Send a blank email to php-notes+get-202287@lists.php.net to get a copy of this message
Anonymous' associative version wasn't working for me, but it did with this small tweak: function array_unshift_assoc(&$arr, $key, $val) { $arr = array_reverse($arr, true); $arr[$key] = $val; $arr = array_reverse($arr, true); return $arr; } ---- Server IP: 72.52.91.14 Probable Submitter: 184.65.57.38 ---- Manual Page -- http://php.net/manual/en/function.array-unshift.php Edit -- https://master.php.net/note/edit/117119 Del: integrated -- https://master.php.net/note/delete/117119/integrated Del: useless -- https://master.php.net/note/delete/117119/useless Del: bad code -- https://master.php.net/note/delete/117119/bad+code Del: spam -- https://master.php.net/note/delete/117119/spam Del: non-english -- https://master.php.net/note/delete/117119/non-english Del: in docs -- https://master.php.net/note/delete/117119/in+docs Del: other reasons-- https://master.php.net/note/delete/117119 Reject -- https://master.php.net/note/reject/117119 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#202287) next »