Getting Text From The Internet with PHP

This is a class very close to the Ruby version to get text.

<?php
class httprequest {

    function httprequest() {
    }

	function get($url) {
		if (substr($url,0,7) != "http://"){
			$url = 'http://'.$url;
		}
		$html = implode('', file($url));
		return $html;
	}

	function post() {

	}

}
?>
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • LinkedIn
  • RSS
  • StumbleUpon
  • Twitter

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)