通过javascript获取屏幕宽度到php变量

for reasons that I won't get into here, I need to remove a plugin based on screenwidth. I can use CSS to 'display: none' but that is not sufficient because the code is still there and it causes a conflict. So I have been trying to get screen width via javascript and send that to the php file to keep the plugin from loading in this instance. However, I'm unclear how to access that variable in php.

Here is what I have so far:

var sWidth = window.screen.width;
alert("sWidth is: " + sWidth);
var xhttp = new XMLHttpRequest();
var url = "wp-content/plugins/NKS-custom/main.php?width=" + sWidth;
xhttp.open("GET", url, true);
xhttp.onload = function() { 
    alert("Result: " + xhttp.responseText); 
};
xhttp.send(null);

I got this code from somewhere else and I am unclear if I should specify the index.php file for 'var url' or the actual plugin file.

I'd like to have an if/then statement in the php that executes the plugin code only if the screen width at certain size. How do I grab the width from the javascript and how can I test to make sure the php is processing it? I saw something like this in the same forum answer but it doesn't seem to work:

$screen=$_GET["width"];
echo $screen;

Do I use "width" as in their example above or should I be grabbing the "sWidth" variable in the php (or something else completely)? And if so, what is the correct syntax? Thanks in advance for any suggestions.