global variable for path In my project I want to provide path of some files from root directory. Path has repeated 4 to 5 time in one module so I am thinking that put one global variable and access that variable in same module?

I have try (dirname(__FILE__).'\sound\new'); realpath; drupal_realpath ; pathinfo; .
You can get the path using drupal default function drupal_get_path();

It return path to any module or theme from root of installation.

If i want to access path of any module e.g. mymodule

Then i just need to use,

$path = drupal_get_path('module','mymodule');   //path to module directory


If i want to access path of my theme e.g. mytheme

$path =  drupal_get_path('theme','mytheme');   //path to theme directory


Now you can make the path variable global..