if(!(isset($_POST['title'])&&(!empty($_POST['title'])))){...}
当$_POST['title']是0的时候:
不是null的情况,isset($_POST['title'])为true,那么!isset($_POST['title'])为false;
同时,无论什么类型,empty($_POST['title'])都为true,那么加上引号后,!empty($_POST['title'])为false;
false&&false还是false,!(false&&false)是true,最终条件成立,发布标题0,弹窗。
当$_POST['title']是空格的时候:
isset($_POST['title'])为true,empty($_POST['title'])为false,!empty($_POST['title'])为true,true&&true还是true,!(true&&true)是false,最终条件不成立,发布空格标题,不弹窗。
--------------------------------------分割线--------------------------------------------
if(trim($_POST['title'])==null){
echo "<script>alert('标题不能为空');window.location.href='article.add.php'</script>";
}