How can variables from cookies be displayed?

To display variables from cookies in PHP, you can use the $_COOKIE superglobal array. This array contains all the cookies sent by the client. You can access the variables by using the cookie name as the key in the $_COOKIE array. Simply echo out the value of the desired cookie variable to display it on the page.

if(isset($_COOKIE['cookie_name'])) {
    echo $_COOKIE['cookie_name'];
}