Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function HTMLMin($html)
- {
- $request = curl_init();
- curl_setopt($request, CURLOPT_URL, "http://willpeavy.com/minifier/");
- curl_setopt($request, CURLOPT_REFERER,"http://willpeavy.com/minifier/");
- curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($request, CURLOPT_HEADER, TRUE);
- curl_setopt($request, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9");
- curl_setopt($request, CURLOPT_POST, 1);
- curl_setopt($request, CURLOPT_POSTFIELDS, 'html=' . urlencode($html));
- $reqResponse = curl_exec($request);
- $s_parts = NULL;
- if (preg_match('%<textarea id="html" name="html">(.*?)</textarea>%si', $reqResponse, $s_parts)) {
- return urldecode($s_parts[1]);
- curl_close($request);
- }
- return $reqResponse;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement