PHP

PHP (important ones are bolded [not to be skipped]) OOP

  1. Classes and Objects

  2. Constructors/Destructors

  3. Magic Methods [ methods that are automatically executed eg. __wakeup, __destruct ]

  4. Access Modifiers (private, public, protected)

  5. Inheritance [ usage of (extends keyword) to inherit properties and methods from a class ]

  6. Abstract Classes (and) Interfaces [ defines what methods should be in a class ]

  7. Traits [ allows child to inherit from multiple parents (use TraitName keyword) ]

  8. Static [ call methods/properties from class directly using ClassName::staticMethod(); ]

  9. Namespaces/Nested Namespaces [ to use classes outside a namespace new Html\Table(); ]

PHP $_FILES

There is one global PHP variable called $_FILES. This variable is an associate double dimension array and keeps all the information related to uploaded file. So if the value assigned to the input's name attribute in uploading form was file, then PHP would create following five variables −

  • $_FILES['file']['tmp_name'] − the uploaded file in the temporary directory on the web server.

  • $_FILES['file']['name'] − the actual name of the uploaded file.

  • $_FILES['file']['size'] − the size in bytes of the uploaded file.

  • $_FILES['file']['type'] − the MIME type of the uploaded file.

  • $_FILES['file']['error'] − the error code associated with this file upload.

File Upload Procedure Server Side

  • When uploading a file, the file is first stored in the tmp_name directory.

  • The uploaded file is first checked, before using the following code to move it.

move_uploaded_file(from_tmp_directory, actual_storage_destination)

Last updated