I can't kind of make out the first return statement, can anybody help to explain how it works?
the array_map accept a function for the first arg, but here is an array. and how does array(&$this, '_trimData') work? thanks for explaining.
private function _trimData($mParam)
{
if (is_array($mParam))
{
return array_map(array(&$this, '_trimData'), $mParam);
}
$mParam = trim($mParam);
return $mParam;
}
This is a recursive function.
_trimDatacalls itself if the parameter passed to it was an array.array(&$this, '_trimData')is a callback to the current object's method_trimData.The entire method could really be replaced with: