How to view php source code?

Hi, I was wondering how I can view the php source code of a website?  I notice that when I use firebug or just view the regular source code that I can never see the php code and I would really like to be able to do that!  If anyone knows of a way please let me know. Thanks
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Avinash ZalaWeb ExpertCommented:
i think in browser you can't see the php code,

But if you know the actual path of the php file then you can do this by below php function.


Hope this helps,
Om PrakashCommented:
You cannot see the PHP code of pages rendered in web browser. You can only see the HTML code generated by the PHP code from Browser.

Using firebug you can see the HTML/javascript/css files since they are static files but not PHP code.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Loganathan NatarajanLAMP DeveloperCommented:
You cannot the source of PHP files through firebug or any other tool from Client Side... you have to have server access or direct file access to view the source of PHP
It is impossible to view PHP source. You can only see PHP on your server, but not others. There are few PHP functions that allows you to see the PHP on the same server. I'm not sure but I thing fread(); can show the code, but I'm not 100% sure.
YOU CAN'T. The server (eg, apache) which hosts the php files process the files to generate necessary HTML codes with PHP engine so that browser can render it. No browser can understant PHP codes. All the PHP codes are processed in server and you'll only get HTML.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.