How to handle the "undefined function: array_combine()" error

vandkbook

New Member
If you get above Error it is because you are running Fabrik on an older PHP Version and an element is trying to call a function which does not exist.

To get aound the Error simply add the following code to the element code which is not working (at best directly at the beginning of the code).

if(!function_exists('array_combine')){
function array_combine($keys, $values){
if(count($keys) < 1 || count($keys) != count($values) || !is_array($keys) || !is_array($values)){
return false;
}

$keys = array_values($keys);
$values = array_values($values);
for($x=0; $x < count($keys); $x++){
$return_array[$keys[$x]] = $values[$x];
}

return $return_array;
}
}
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top