الفصل الرابع
Print "Value sum of 9,6 =".$s;
=".$m ;
Print "<BR> Value of Multiply of 9,6 =”.
?>
http://localhost/test/p034 - Microsoft
File Edit View Favorites Tools Help
الدوال Functions
Back Address
Forward
Stop Refresh Home
http://localhost/test/p034
Go Links
Value sum of 9,6=15
Value of Multiply of 9,6=54
Done
function square ($num) {
return $num * $num;
echo square (4); // outputs '16'..
Local intranet
النتيجة :
مثال :
لا يمكن إرجاع عدة قيم من الدالة لكن يمكن الحصول على نتائج مشابهة عند إرجاع
<?
function small_numbers() {
return array (0, 1, 2);
}
list ($zero, $one, $two) = small_numbers();
echo "<BR> First variable = $zero";
echo "<BR> Second variable = $one"; echo "<BR> Third variable = $two"; ?>
لائحة list مثال :
ΛΕ
ص ٨٤