エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
【PHP】is_nullもissetもemptyも絶妙に微妙なので、"is_nullorempty"を自作しよう - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
【PHP】is_nullもissetもemptyも絶妙に微妙なので、"is_nullorempty"を自作しよう - Qiita
<?php if (!function_exists('is_nullorempty')) { /** * validate string. null is true, "" is true, ... <?php if (!function_exists('is_nullorempty')) { /** * validate string. null is true, "" is true, 0 and "0" is false, " " is false. */ function is_nullorempty($obj) { if($obj === 0 || $obj === "0"){ return false; } return empty($obj); } } if (!function_exists('is_nullorwhitespace')) { /** * validate string. null is true, "" is true, 0 and "0" is false, " " is true. */ function is_nullorwhitespace($