How to print value of cookie in php

Below is the code to print the value of cookie in php:

<?php

if(isset($_COOKIE["YourCookieName"])){
    echo "Cookie Value: " . $_COOKIE["YourCookieName"];
} else{
    echo "Cookie not set";
}

?>