<?php
$testArray = array('Test1', 'Test2', 'Test1');
print_r( array_unique($testArray));
// Array ( [0] => Test1 [1] => Test2 )
?>
<?php
$testArray = array('Test1', 'Test2', 'Test1');
echo( count($testArray)); // 3
echo( sizeof($testArray)); // 3
?>
<?php
echo $length = strlen("Efforts"); // 7
?>
<?php
echo $_SERVER['REMOTE_ADDR']
?>
<?php
echo $_SERVER['HTTP_REFERER']
//will return the previous page
?>
<?php
$startDate=explode("-", "02-08-2010");
$endDate=explode("-", "26-04-2007");
echo gregoriantojd($startDate[1], $startDate[0], $startDate[2])
- gregoriantojd($endDate[1], $endDate[0], $endDate[2]);
//1194
?>
<?php
error_reporting(0);// Will not report any error
error_reporting(-1);// Shows all errors
?>
<?php
set_time_limit(2); //
// If the value is "0" , it will rum for unknown time
?>
<?php
$file = 'testFile.pdf'; // file to be downloaded
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); header("Content-type: application/pdf");
header('Content-length: '.filesize($file));
header('Content-disposition: attachment; filename='.basename($file));
readfile($file);
exit;
?>
<?php
$file = 'testFile.pdf'; // file to be downloaded
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); header("Content-type: application/pdf");
header('Content-length: '.filesize($file));
header('Content-disposition: attachment; filename='.basename($file));
readfile($file);
exit;
?>
Zend | Magento Certified PHP | eCommerce Architect