This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$n = 11; | |
if ($n != 10) { | |
echo "the number is not 10"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$n = 10; | |
if ($n == 10) { | |
echo "the number is 10"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mul($x, $y){ | |
return $x * $y; | |
} | |
echo mul(8, 8); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function info(){ | |
return "this is the return value.."; | |
} | |
echo info(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function info($name = "no name", $family = "no family name", $age = "0"){ | |
echo "hi my name is: $name $family and I'm $age"; | |
} | |
info("Rasoul", "Vatanparast", 22); | |
echo "<br />"; | |
info(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function login($username, $pass){ | |
if($pass == 1234 && $username == "rasoul"){ | |
echo "login successful"; | |
}else{ | |
echo "invalid username or password"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function nameOfFunction(){ | |
echo "this is a function..."; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function nameOfFunction(){ | |
echo "this is a function..."; | |
} | |
nameOfFunction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = 10; | |
$y = 15; | |
function test(){ | |
$GLOBALS['x'] = $GLOBALS['x'] + $GLOBALS['y']; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$x = 10; | |
$y = 15; | |
function test(){ | |
global $x, $y; | |
$x = $x * $y; | |
} |
NewerOlder