Home  >  Article  >  Backend Development  >  php概念-变量函数

php概念-变量函数

WBOY
WBOYOriginal
2016-06-13 11:02:22760browse

php概念--变量函数

<?php function zhang(){        echo "My name is zhang, \n";    }    function noname($name){      echo "My name is $name, \n ";     }    $show = 'zhang';    $show();      //<span style="color: #ff00ff;">这与写 zhang()一样;    $show = 'noname';    $show(Harry);   // <span style="color: #ff00ff;">这与编写noname('Harry') 一样;</span>?>
?变量函数是php最优秀的功能,在一个变量名后面附加()后,php就会尝试寻找具有相同名称的函数并试图执行它

1 楼 lanlansnss 2012-03-05  
{$show}('harry');

2 楼 lanlansnss 2012-03-05  
博客非常的好,尤其是js部分。特别的细致。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn