How to use cookies in PHP?

To set the cookie we use php inbuilt function setcookie(name,value). In this method name is use to set the name of cookie and value is use to set the value which we want to use. How to use cookies in PHP?

Syntax :- setcookie(cookie_name, cookie_value);

Example :- setcookie(“shop_name”,$_GET[‘shop_name’]);

After set the cookie if we want to fetch the cookie, we use global variable $_COOKIE[“cookie_name”]

Example to get cookie in variable $store = $_COOKIE[“shop_name”];

sexpoundsofttechsolution

How to use cookies in PHP?