How to identify the file extension of an uploaded file PHP
Wednesday, November 11th, 2009$ext = strtolower(substr(strrchr($file[’name’], ‘.’), 1));
$ext = strtolower(substr(strrchr($file[’name’], ‘.’), 1));
Try these:
post_max_size = 16M
upload_max_filesize = 16M
memory_limit = 16M
(memory_limit only affects this if you have configured
php with –enable-memory-limit)
vi /etc/php.ini
Initialise a blank array and feed it some values.
$b = array();
$b[] = ‘a’;
$b[] = ‘b’;
$b[] = ‘c’;
Particularly useful if you want to loop over some database results and add to the array.
Simple technique to output a php array (in an easy to read style) to a page:
#foreach ($_GET as $key => $value) {
# echo “key=”.$key.” —— value=”.$value;
#}
foreach ($_POST as $key => $value) { echo ‘key=’.$key.’ - value=’.$value.’
‘; }
Sitepoint article
http://www.sitepoint.com/article/generate-pdfs-php/
PDF Lib
http://www.pdflib.com/download/
Difference between require() and require_once(): require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page).
So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don’t include the file more times and you will not get the “function re-declared” error.
Difference between require() and include() is that require() produces a FATAL ERROR if the file you want to include is not found, while include() only produces a WARNING.
There is also include_once() which is the same as include(), but the difference between them is the same as the difference between require() and require_once().
Nice function:
Best way is to simply use yum.
Yum install name of software
Thats it.