This file contains 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 | |
/* redirecting */ | |
/* follow me on instagram : saaeid.dev | |
follow me on twitter : @metasaeid */ | |
error_reporting(E_ALL ^ E_NOTICE); | |
$id = $_GET["id"]; |
This file contains 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 | |
session_start(); | |
$_SESSION["b"] = 12; | |
$_SESSION["c"] = array(3 , 10 , 11 , 12 , 18); | |
print_r($_SESSION); |
This file contains 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 Saeid_func($a , $b , $c , $d){ | |
if($a > $b && $c > $d){ | |
$a = $a * 2; | |
$b = $b / 2; | |
$x = $a + $b; | |
} | |
else{ | |
$a = $a; |
This file contains 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 My_func($a , $b , $c , $d , $e){ | |
if($a > 20 && $b < 10){ | |
$a = $a / 2; | |
$b = $b * 2; | |
} | |
else{ | |
$a = $a; |
This file contains 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 | |
$text = "Welcome to PHP !"; | |
$a = urlencode($text); | |
$b = urldecode($a); | |
echo '<p>Original text: '.$text."</p>"; | |
echo '<p>After urlencode: '.$a."</p>"; |
This file contains 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 get_value($param, $default = null) { | |
if(isset($_GET[$param])) { | |
$value = $_GET[$param]; | |
} else { | |
$value = $default; | |
} | |
return $value; | |
} |
This file contains 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 | |
print_r($_SERVER); | |
?> |
This file contains 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 | |
try{ | |
$x = 0; | |
$y = Inverse($x); | |
echo "The Inverse Of $x is $y"; | |
}catch (Exception $e){ | |
$y = "Undefined"; |
This file contains 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 | |
/* a few functions for debugging in php */ | |
$a = 100; | |
$b = 500; | |
$c = 3.333; | |
$r = var_dump($c); | |
$e = print_r($b); |
NewerOlder