我想知道正确的方法
$dynValue=5;//loop this many times
//start of my loop
for ($num=1; $num <= $dynValue; $num++){
//note the incremented number ($num) in the call back
add_action(\'add_meta_boxes\', \'mpc_meta_box_\'.$num.\');
//below is where im having the problem
// i am trying to increment this function name so i will not get the error that "function name has already been declared". i cannot add \'.$num.\' in the func name below cause its not valid php.
function mpc_meta_box_\'.$num.\'(){
//some content
}
}//end of my loop
我可以用eval()来实现这一点,但我知道不建议这样做