Browsing: PHP Snippet

This section contains various php snippet or call it hacks related to dates, database, files, basic programming and many more. These codes proves more than useful in day to day programming.

PHP Snippet Php Snippet
2

Image validation using JavaScript are not secure. Good programmers “NEVER TRUST USERS”, they validate image both at client and server side. In this tutorial I am going to explain how to validate Single/multiple image and upload in PHP.

PHP Snippet Php Snippet
0

If you are looking for a way to force download file in PHP try this snippet. PHP function to get the mime type of the file. Download file with proper validation & error messages.

PHP Snippet Php Snippet
2

Server side validation check is the most common code we developers do everyday. Checking variable for null or empty string is the most written code. So I have made a custom function to check the variable which returns TRUE or FALSE based on the variable.

PHP Snippet Php Snippet
0

A custom function to truncate string by words in php. A common scenario will be when you need to display just a short version of description from the long description. This function come in very handy in those situations.

PHP Snippet Php Snippet
3

This php snippet prints current page url. It accepts a Boolean parameter as TRUE/FALSE which acts as a flag for displaying query string. It returns the current site URL.

1 2 3

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.