note 44103 deleted from function.array-combine by tomsommer
| From: | tomsommer@php.net | Date: | Fri, 16 Jul 2004 17:32:36 +0000 |
| Subject: | note 44103 deleted from function.array-combine by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73407@lists.php.net to get a copy of this message | ||
Note Submitter: trosos@atlas.cz
----
For those who wants to use the array_combine() in php 4, there is an alternative:
<?php
if (!Function_Exists('array_combine'))
{
function Array_Combine($Keys,$Values)
{
Reset($Keys);
Reset($Values);
$Result=array();
while
(((
($Key=Each($Keys)) !==False
)
or
(((
Each($Values) !==False
)
or
(
Count($Keys) ===0
)
)
and
(
$Result=False
)
)
)
and
((
($Value=Each($Values)) !==False
)
or
(
$Result=False
)
)
and
(
($Result[$Key[1]]=$Value[1]) or True
)
) {};
return($Result);
}
}
?>