Skip to content

Instantly share code, notes, and snippets.

View saaeiddev's full-sized avatar
🎯
Focusing

Amir Saeid Dehghan saaeiddev

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