[eluser]stef25[/eluser]
ive got some processing code in my controller id like to break out in to a separate function.
the function in question is at the bottom and its called from
Code:
$existing_tags = array_flatten($existing_tags);
Code:
function array_flatten($array)
{
$ab = array(); if(!is_array($a)) return $ab;
foreach($a as $value){
if(is_array($value)){
$ab = array_merge($ab,array_flatten($value));
}else{
array_push($ab,$value);
}
}
return $ab;
}
this returns a "Call to undefined function array_flatten()" even though both snippets are in the same controller file.
i dont want this function to be accessible from the url but i removed the _underscore just to debug.
this is basic php but im stumped. anyone?