لطفا اطلاعات خود را بصورت فارسی وارد کنید
function add($number1, $number2) { $sum = $number1 + $number2; return($sum); } $x = 10; $y = 20; add($x , $y); echo $sum;
function addNumbers(int $a, int $b) { return $a + $b; } echo addNumbers(2, "3 days");
declare(strict_types=1); function addNumbers(int $a, int $b) { return $a + $b; } echo addNumbers(2, "3 days");
function add_five(&$num) { $num += 5; } $num = 2; add_five($num); echo $num;
$x = 5; function myTest() { $y = 10; return($y*2); } myTest();
$x = 2; $y = 4; function TestScope($y, $z) { global $x; echo $x+$y+$z; } $z =6; TestScope($y,$z);
function TestScope() { static $x = 1; echo $x; $x++; } TestScope(); TestScope(); TestScope();
$x = "Hello PHP"; echo strpos($x, "P");
$x = 5.25; echo floor($x); echo ceil($x); echo round($x);
function addNumbers($a,$b){ $c = $a + $b; ....... } $a = 3; $b = 2; echo addNumbers($a,$b);
$x = 5; function Test($x){ $x = 10; echo $x; } $x = 3; Test($x); echo $x;
echo date("j F Y");