Create a script page for handling ajax
In your hook_menu, create a menu item with 'type' =&gt; MENU_CALLBACK, like so:

$items['YOUR_MENU_PATH'] = array(
  'page callback' =&gt; 'YOUR_PAGE_CALLBACK',
  ...
  'type' =&gt; MENU_CALLBACK,
);


Then, in your page callback function, you can use the drupal_json_output($some_array) function to convert $some_array to json, and return it, all in one go.

I wouldn't use the .php extension in the menu path.