I think you can simply return (strtolower($server_request) == $ajax_request);
In JS it works for sure, just do not remember 100% about PHP