Simple httpcode monitor
Two things:


Always specify the visibility. Don't use the old var keyword, use public, private or protected. Since the class-member $url contains internal information, you'll probably want to hide that information (you've already implemented a getter method so that the information can be read but not written):

class website {
    protected $url;

    public function __construct($url) {
        $this-&gt;url = $url;
    }

    // ...

Every instance of this class seems to be meant to represent one website. But your method "get_httpcode()" works for every website (it expects a URL; this is exactly what you've already noticed by yourself). It would be more natural to skip the parameter and return the HTTP-Statuscode for the url that is bound to the instance (you've "remembered" the URL in the class-member variable $this-&gt;url):

class website {
    // ...

    public function get_httpcode() {
        // ...
        curl_setopt($ch, CURLOPT_URL, $this-&gt;url);
        // ...
    }
}

// Usage:
$google = new website("http://www.google.com");
$statusCode = $google-&gt;get_httpcode();