En los comentarios de los usuarios del manual oficial de PHP (
www.php.net/array_combine) de casi todas las funciones suele haber ejemplos o implementaciones de esas mismas funciones para otras versiones de PHP.
Por ejemplo:
Cita: array_combine
kevlar at ccs dot neu dot edu
04-Aug-2004 03:30
for those of you who do not have the ability to upgrade to php5 or dont want to bother with the pear stuff and just want a simple function def this func that i put together may work just as well as the php5 version
<?php
function arraycombine($a, $b) {
$num = count($a);
if ($num != count($b) || $num == 0) return false;
$a = array_values($a);
$b = array_values($b);
$c = array();
for ($i = 0; $i < $num; $i++) {
$c[$a[$i]] = $b[$i];
}
return $c;
}
?>
Un saludo,