php call_user_func

<?php
function barber($type)
{
    echo "You wanted a $type haircut, no problem\n";
}
call_user_func('barber', "mushroom");
call_user_func('barber', "shave");
?>

以上例程会输出:

You wanted a mushroom haircut, no problem
You wanted a shave haircut, no problem
posted @ 2014-12-26 11:31  Forward1990  阅读(113)  评论(0编辑  收藏  举报