//自定义函数 function functionName(){echo"this is function";}//调用函数functionName();//带参数函数function familyName($name,$age){echo"xiao $name $age";}//调用带参数函数familyName("王",21);//默认带参数值函数 function family($years=66){echo"this family is $years";}//调用带参数的函数,将使用默认值66family();//调用带参数的函数,将使用值88family(88);//带返回值的函数function city($name,$postcode){$ar=array($name,$postcode);return $ar;}//调用带返回值函数$ar=city("b","100000");$city=$ar[0];$postcode=$ar[1];echo"this city is $city,post code is $postcode";