How can you display a message indicating whether a cookie has been set or not in PHP?

To display a message indicating whether a cookie has been set or not in PHP, you can check if the cookie is set using the isset() function and then display a corresponding message. If the cookie is set, you can display a message saying "Cookie is set", and if it is not set, you can display a message saying "Cookie is not set".

if(isset($_COOKIE['cookie_name'])) {
    echo "Cookie is set";
} else {
    echo "Cookie is not set";
}