PHP does not show an error when I only set the unique status = in if

advertisements

My code as follows:

if($_POST['user_id'] = ''){
  //some statement;
}

In the above if condition I have put only single =. PHP is not showing any error but I am getting a white blank page. Does anyone has any clue?


if($_POST['user_id'] = '') means:

$_POST['user_id'] becomes '' .. if ('') // always false

if($_POST['user_id'] == '') means:

$_POST['user_id'] compares to '' .. if ( comparison)