hi to all
how do i pass parameters value using call back function in array_list
<?php
class A
{
public $Menu = array(
array("LeftValue"=>5,
"name"=>'test'
),
array("LeftValue"=>6,
"name"=>'test one'
),
array("LeftValue"=>7,
"name"=>'test two'
),
array("LeftValue"=>8,
"name"=>'test three'
),
array("LeftValue"=>9,
"name"=>'test four'
),
array("LeftValue"=>10,
"name"=>'test five'
),
);
public $a;
private function BreadCrumbsMenu($MenuOutput,$a,$b) // this should receive paramers
{
if($MenuOutput['LeftValue'] > $a && $MenuOutput['LeftValue'] < $b)
{
return true;
}
else
{
return false;
}
}
public function test()
{
$BreadMenuOutput = array_filter($this->Menu, array($this, 'BreadCrumbsMenu',array(2,3))); // this should pass paramerers
}
}
$test = new A();
$test->test();
?>
when executed
array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in
TIA