Is it possible to have a HTML SELECT/OPTION value as NULL using PHP?

后端 未结 5 1236
Happy的楠姐
Happy的楠姐 2020-12-29 19:42

The following is a snippet from my HTML form which pulls the options from the table rows accordingly.

What I want to do is have the first option value to be NULL so

5条回答
  •  太阳男子
    2020-12-29 19:55

    In php 7 you can do:

    $_POST['value'] ?? null;
    

    If value is equal to '' as said in other answers it will also send you null.

提交回复
热议问题