I'm trying to write an extension for php using swig. I need to know the absolute path of the current php file in my extension code. I used __ FILE __ in my C code but it returns current c file name.
2 Answers
You can use the realpath() function. Specify the name of your current file.
hint: man 3 realpath or http://www.freebsd.org/cgi/man.cgi?query=realpath&sektion=3
2 Comments
Ali choobdar
I dont know the current file name. it might be any file of my project. by the current file name i mean the php file that called the extensions function.
Álvaro González
If the OP already knew
pathname he wouldn't need this function ;-)