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 | |
/* Example 2 */ | |
// yes, the argument list can be empty | |
function foo() { | |
// returns an array of all passed arguments | |
$args = func_get_args(); | |
foreach ($args[0] as $k => $v) { |
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 | |
/* Example 1 */ | |
// yes, the argument list can be empty | |
function foo() { | |
// returns an array of all passed arguments | |
$args = func_get_args(); | |
foreach ($args as $k => $v) { |
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 | |
global $x; | |
$x = "asd"; | |
asd(); | |
function asd() | |
{ | |
global $x; |
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 | |
$dosya = fopen ("ftp://kullanici:[email protected]_bir_site.com/gelen/yazilan_dosya", "w"); | |
if (!$dosya) { | |
echo "<p>Uzak dosya yazmak için açılamıyor.\n"; | |
exit; | |
} | |
/* Veriyi burada yaz. */ | |
fwrite ($dosya, $_SERVER['HTTP_USER_AGENT'] . "\n"); | |
fclose ($dosya); | |
?> |
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 | |
class Foo | |
{ | |
public $var = '3.14159265359'; | |
} | |
$baseMemory = memory_get_usage(); | |
for ( $i = 0; $i <= 100000; $i++ ) | |
{ |
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["A"] = "Some New Value"; // set new value | |
print_r($_SESSION); | |
$_SESSION["B"] = "Some New Value"; // set new value | |
$_SESSION["C"] = "Some New Value"; // set new value | |
print_r($_SESSION); | |
session_reset(); // old session value restored | |
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 getBrowser() | |
{ | |
$u_agent = $_SERVER['HTTP_USER_AGENT']; | |
$bname = 'Unknown'; | |
$platform = 'Unknown'; | |
$version= ""; | |
//First get the platform? | |
if (preg_match('/linux/i', $u_agent)) { |
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 | |
$temp_file = tempnam("/", "FOO"); | |
echo $temp_file; | |
// $file = fopen($temp_file, "w"); | |
// fwrite($file, "temp file content"); | |
// fclose($file); |
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 | |
$fh = fopen('/proc/meminfo','r'); | |
$mem = 0; | |
while ($line = fgets($fh)) { | |
$pieces = array(); | |
if (preg_match('/^MemTotal:\s+(\d+)\skB$/', $line, $pieces)) { | |
$mem = $pieces[1]; | |
break; | |
} | |
} |
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
"autoload": { | |
"classmap": [ | |
... | |
], | |
"psr-4": { | |
"App\\": "app/" | |
}, | |
"files\\": [ | |
"app/helpers.php" | |
] |
NewerOlder