note 83212 added to function.current
| From: | aefxx at osu1 dot php dot net | Date: | Thu, 15 May 2008 15:39:40 +0000 |
| Subject: | note 83212 added to function.current | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139410@lists.php.net to get a copy of this message | ||
A simple copy function that not only copies the given array but ensures the copy's pointer is
set to the exact same position:
function array_copy(&array)
{
$key = key($array);
$copy = $array;
while (($copy_key = key($copy)) !== NULL) {
if ($copy_key == $key) break;
next($copy);
}
return $copy;
}
That's all ... bye.
----
Server IP: 217.13.201.10
Probable Submitter: 88.65.184.7
----
Manual Page -- http://www.php.net/manual/en/function.current.php
Edit -- https://master.php.net/note/edit/83212
Del: integrated -- https://master.php.net/note/delete/83212/integrated
Del: useless -- https://master.php.net/note/delete/83212/useless
Del: bad code -- https://master.php.net/note/delete/83212/bad+code
Del: spam -- https://master.php.net/note/delete/83212/spam
Del: non-english -- https://master.php.net/note/delete/83212/non-english
Del: in docs -- https://master.php.net/note/delete/83212/in+docs
Del: other reasons-- https://master.php.net/note/delete/83212
Reject -- https://master.php.net/note/reject/83212
Search -- https://master.php.net/manage/user-notes.php