首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

php概念-变量函数

2012-12-22 
php概念--变量函数?phpfunction zhang(){echo My name is zhang, \n}function noname($name){echo My

php概念--变量函数

<?php    function zhang(){        echo "My name is zhang, \n";    }    function noname($name){      echo "My name is $name, \n ";     }    $show = 'zhang';    $show();      //这与写 zhang()一样;    $show = 'noname';    $show(Harry);   // 这与编写noname('Harry') 一样;?>
?变量函数是php最优秀的功能,在一个变量名后面附加()后,php就会尝试寻找具有相同名称的函数并试图执行它。 1 楼 lanlansnss 2012-03-05   {$show}('harry'); 2 楼 lanlansnss 2012-03-05   博客非常的好,尤其是js部分。特别的细致。

热点排行