ummmm....well, first off, php is a server-side scripting language...errors aside, you will never find the source code to a php file...
in the example you gave, detail.php is passed a variable $type with a value of 'snippet' and a variable $id with a value of 'SOME_NUMBER'.
All the logic on how to handle these variables and values is in the detail.php script.
java-script is client-side...you see it in the source code, it hogs the end user's resources to execute, and is succeptable to all the troubles with cross-platform compatability...
php is server-side. your scripts live on your web server, are run by your web server.
you really need to do some more research....i'm not going to spend hours explaining this stuff to you. i learned it all by myself, and so can you.
www.hotscripts.com - download some php programs and read the code
www.php.net - the 'official' php site. read the manual.
www.google.com - use a search engine!
-dolphinsnot