Checking if a $_COOKIE value is empty or not

后端 未结 6 1975
盖世英雄少女心
盖世英雄少女心 2021-01-15 12:27

I assign a cookie to a variable:

$user_cookie = $_COOKIE[\"user\"];

How can I check if the $user_cookie received some value or

6条回答
  •  日久生厌
    2021-01-15 13:20

    Try empty function in php http://php.net/manual/en/function.empty.php

    You can also use isset http://www.php.net/manual/en/function.isset.php

提交回复
热议问题