PHP Create and delete cookies using query strings
<p>I have the following two links:</p>

<pre><code>&lt;a href="index.php?showDesktop=true"&gt;Show Desktop&lt;/a&gt;

&lt;a href="index.php?showMobile=true"&gt;Show Mobile&lt;/a&gt;
</code></pre>

<p>What I want to do is make it so that if the showDesktop query is clicked then create a cookie called showDesktop and delete the cookie showMobile and the vice-versa. I have tried the following so far, but think I'm doing it wrong. Can anyone help me get this working as proposed.</p>

<pre><code>if($_GET['showDesktop']) {
    $_COOKIE('showDesktop', 'yes');
    $_COOKIE('showMobile', null);
}
else if($_GET['showMobile']) {
    $_COOKIE('showDesktop', null);
    $_COOKIE('showMobile', 'yes');
}
</code></pre>
