You cannot check PHP files with your validation service.
That's because it is a markup validation service, and PHP isn't markup.
I would either recommend adding full PHP support
Any decent tool to test the validity of the HTML generated by PHP would have to run the PHP repeatedly with different input so that sufficient different outputs were all tested. Coming up with good, generic input (which would vary query strings, POST data, headers) would be very difficult and end up with an enormous list and still miss plenty of cases. Running through that huge list would put a lot of load on the computer running the validation service.
Any test data needs to be tailored for the specific PHP program. This problem is far better solved in the test suite for the PHP than at the validator. The tests can run the PHP with suitable input, capture the output and then hand it over for validation (using the API).
or treating PHP files as HTML, and ignore the <?php ?> tags.
Again, lots of PHP programs would fail because the effects of running the PHP code are required to get valid markup output from the program.