How to check if a file exists in the upload file array in PHP
While I was uploading a file into the database, I was set an empty check-up if I did not choose any file so it will back me a message. But it all time goes to if part did not come in the else part. What I will do about it?
My Code:
if(!empty($_FILES['upload_file']['name'])) { echo "My message"; }else { echo "My message 2"; }
Question and answer is powered by AnsPress.io