Close
All

Top 10 PHP Interview Questions and Answers

Top 10 PHP Interview Questions and Answers

For example:

header(‘Location: http://www.example.com‘);

It’s important to note that the header() function must be called before any HTML or output is sent to the browser, otherwise it will not work.

  1. How do you handle file uploads in PHP?

Handling file uploads in PHP can be done using the $_FILES superglobal array. This array is populated with information about the uploaded files, such as the file name, type, and size. To handle file uploads, you need to make sure that the form that the user is uploading the file from has the attribute “enctype” set to “multipart/form-data”.

For example:

Leave a Reply

Your email address will not be published. Required fields are marked *