NULL, 'errors' => ''); $content = validator::__getContent($input); $http = new HttpClient('www.htmlhelp.com',80); $http->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021207'); $http->useGzip(false); $http->setPersistReferers(false); $params = array('area' => $content,'charset' => $charset); if ($http->post('/cgi-bin/validate.cgi',$params) !== false) { $result = $http->getContent(); if (strpos($result,'

Congratulations, no errors!

')) { $res['valid'] = true; } else { $res['valid'] = false; if ($errors = preg_match('#

Errors

[\s]*()#msU',$result,$matches)) { $res['errors'] = strip_tags($matches[1],'