• Index
  • Archives
  • RSS Feed
  • WP Themes
  • Contact
  • Recent Posts

    • Visualizing Magnetic Fields. C...
      Posted Wednesday June 4th, 2008
    • Use Safari’s Activity Wi...
      Posted Friday May 30th, 2008
    • Peggle Is Very Addictive
      Posted Thursday May 29th, 2008
    • Mac App Idea: Finder Bar Twitt...
      Posted Tuesday May 27th, 2008
    • FWA Theater
      Posted Tuesday May 27th, 2008
  • Browse Posts

  • Links

    • seo
    • Affordable Web Hosting
    • Website Templates
    • Load Cells
    • MySpace Layouts
    • Envelope Seals
    • evden eve nakliyat
    • search engine optimisation
  • Site Sponsors

    • Megastar Media
    • Site5 Hosting

WebRevolutionary

Single Post

W3C Validator PHP Function

Posted Sunday March 25th, 2007 · See Comments

I just finished off this simple little PHP function that some of you may find useful.
It’s a quick way to determine whether a site is valid or not, returning a simple “true or false” result.
Requires the Snoopy class.

function w3Valid($url) {
require("Snoopy.class.php");
$snoopy = new Snoopy;

$snoopy->fetchtext("http://validator.w3.org/check?uri=" . $url . "&output=soap12");
$validator_output = $snoopy->results;

if(preg_match("/false/", $validator_output)) {
return false;
} else {
return true;
}
}


Have Your Say, Leave a Comment