Posted By

troynt on 02/11/09


Tagged

ajax json


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

umang_nine
vali29
lajevardi
jnbn


detect if ajax or json request


 / Published in: PHP
 

  1. function is_ajax()
  2. {
  3. return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND
  4. strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest');
  5. }

Report this snippet  

You need to login to post a comment.