<?php function say_hello() //无参数 { $name="tang"; echo "hello,".$name; echo "<br />"; echo "<hr />"; } say_hello();//函数调用 function say_helloS($some_name)//有参数 { echo "hello,".$some_name; echo "<br/>"; echo "<hr />"; } say_helloS("tang"); say_helloS("xue"); say_helloS("long"); function say_helloT($some_name="tangwei")//带有默认参数的函数 { echo $some_name." is god girl!"; } say_helloT(); ?>
PHP_零基础学php_3PHP函数、传参函数、默认参数、函数返回值,布布扣,bubuko.com
PHP_零基础学php_3PHP函数、传参函数、默认参数、函数返回值
原文:http://www.cnblogs.com/tangt/p/3899350.html