You are building a profile page where users can upload their profile pictures. Which PHP function would you use to ensure the uploaded file is an image type?
- getimagesize()
- is_uploaded_file()
- file_get_contents()
- move_uploaded_file()
The getimagesize() function is used to determine the type of an uploaded file and ensure it's an image type, based on the returned image type information.
Loading...
Related Quiz
- What are some commonly used miscellaneous functions in PHP?
- Which PHP superglobal contains information about headers, paths, and script locations?
- What can happen if a required field is left empty in a PHP form?
- How can you remove the first element from an array in PHP?
- What are the two main string operators?