- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Is it possible to have a HTML SELECT/OPTION value as NULL using PHP?
The short answer is no. POST/GET values are never null. The best they can be is an empty string, which can then be converted to null/'NULL' −
Example
if ($_POST['value'] === '') { $_POST['value'] = null; } echo'Null assigned';
Output
This will produce the following output −
Null assigned
Advertisements
To Continue Learning Please Login
Login with Google