try this
if ($_FILES['img']['size'] != 0 && $_FILES['img']['error'] == 0)
{
// imag is not empty (and not an error)
}
More Related Contents:
- Fatal error: Call to a member function bindParam() [duplicate]
- How to escape single-quote (apostrophe) in string using php
- Where can I read about conditionals done with “?” and “:” (colon)? [duplicate]
- NginX issues HTTP 499 error after 60 seconds despite config. (PHP and AWS)
- A __construct on an Eloquent Laravel Model
- How to get the length of longest string in an array
- Call to undefined function password_hash()
- Remove namespace from XML using PHP
- Best way to connect to MySQL with PHP securely [duplicate]
- How to check whether Suhosin is installed?
- Class Firebase\JWT\JWT not found
- mysqli persistent connection
- Remove or match a Unicode Zero Width Space PHP
- How to create a fluent query interface?
- UTF-8 not working in HTML forms
- In PHP, how does include() exactly work?
- PHP Version 5.2.14 / Parse error: syntax error, unexpected T_FUNCTION, expecting ‘)’
- php headers already sent error [duplicate]
- Best method for converting a PHP array to javascript
- Use json_decode() to create array insead of an object
- How to change public folder to public_html in Laravel
- Group 2d array’s row data by one column and sum another column within each group to produce a reduced 2d array
- Using mysql concat() in WHERE clause?
- RegEx – How To Insert String Before File Extension
- Check if string contains word in array [duplicate]
- download a file from ftp using curl and php
- How to get Unix timestamp in php based on timezone
- How to install GMP extension for PHP
- php default arguments [duplicate]
- Weak typing in PHP: why use isset at all?