PHP File Upload Example

This tutorial will show you how to upload a file using PHP. In this example the file is selected using the browse button and file is uploaded to the ‘uploads’ directory. PHP script stores the file into the defined location and returns response as a success or failure message from the PHP script. As a validation step I have added only to check if you have selected a file for uploading or not.

Continue reading “PHP File Upload Example”

PHP asort() example

This tutorial shows an example how to sort an array using asort() function available in PHP. The asort() function sorts an array by maintaining the index association.

This function sorts an array such that array indices maintain their correlation with the array elements they are associated with. This is used mainly when sorting associative arrays where the actual element order is significant.

Continue reading “PHP asort() example”