Total Pageviews

Friday, June 24, 2011

Some Useful Php Tips

1) to get the file extension during file upload use:
$ext = strrchr($_FILES['file']['name'], '.');

2) To upload a large file, use following tips
pass 'MAX_FILE_SIZE' constant as a parameter and set its size.
this can be done by either defining it as a constant
define(MAX_FILE_SIZE,'1234561')
or passing it in hidden field like this





3) to get all the folders,without files

$dirs = array_filter(glob($path.'*'), 'is_dir');

No comments:

Post a Comment