views:

135

answers:

3

Hi I want to validate my php project to meet the w3 standard so ...Can some one explain how to do the php file validation usind w3c.org

+5  A: 

You do not validate the PHP file on the W3C Validator. What the validator validates is the (X)HTML markup, the output of your PHP pages.

If your PHP project is hosted on the net, simply give the URL to the validator.

If your PHP project is hosted locally, you will have to save the output to a text file and upload this to the validator. To do this, from your browser, open the "File" menu and choose "Save Page As"... (or press CTRL + S).

Alternatively, there are a variety of validator plugins available for your browser. Here are some for Firefox and Chrome.

Andrew Moore
+2  A: 

W3C doesn't standardize php, so you can't validate the php files themselves. But, to validate the HTML or XHTML content of your site, just paste the url into the W3C validator.

Eric Mickelsen
A: 

W3C validates client side markup content, like XHTML, CSS, HTML, etc. It does not validate server side content like PHP.

So, you can validate the output of your PHP pages, not the PHP code itself.

Danny Herran