Question:
How do I check if a function is being passed as a parameter?
Especially if the function being passed is returning a string etc?
IE in the example below I don't want to htmlentities the function html being passed as a parameter, but I do want to htmlentities anything else. Also assuming there could be more than a single parameter that needs to take a function later.
Example:
function html($tag,$content)
{
if(!is_callable($content)){$var=htmlentities($var, ENT_NOQUOTES, "UTF-8");}
return "<".$tag.">".$content."</".$tag.">";
}
echo html(html('Example','Example'),'Example');
This example does not seem to work for me. I still get htmlentitied content when its a function.