FILE_GET_CONTENTS URL URL

New file_get_contents that checks valid urls

function get_contents_url($url, $u = false, $c = null, $o = null) {
        if (filter_var($url, FILTER_VALIDATE_URL)) {
            $headers = get_headers($url);
            $status = substr($headers[0], 9, 3);
            if ($status == '200') {
                return file_get_contents($url, $u, $c, $o);
            }
        }
        return false;
    }
RIFT | Web Development