How to Retrieving value from Ajax (success function) to PHP function.

I was tried to retrieve the value from ajax (success function) to PHP function on same page. But I can’t retrieve the value can anyone please help for this. function example_init(){ drupal_add_js(‘$(document).ready(function () { var url2 = (window.location.search).replace(“?”, “”); //alert(url2); $.ajax({ headers: {“Content-Type”: “application/x-www-form-urlencoded” },[…]