detecting a valid CSS document with PHP?
Is there a way to have PHP detect if a file 开发者_JS百科is a valid CSS document?
I suppose you could use CURL to submit the .css file to the W3 CSS validator. Scraping the results to determine whether the validator thinks the css in question is valid would be a bit of a challenge though, especially if you want to extract the list of errors if it's not valid.
If you hammer their validator with a lot of requests, however, they could possibly block you. Be aware of that if you do go the curl route.
精彩评论