url(s)
function set_url(this->url = url);
if (strpos(this->url = '' . url_segments = @parse_url(url_segments))
{
url_segments['port']) ? url_segments['path'] = isset(url_segments['path'] : '/';
url_segments['path'], 0, strrpos(url_segments['base'] = url_segments['host'] . url_segments['prev_dir'] = url_segments['base'], 0, strrpos(url_segments['base'] . '/';
url_segments;
/*
URL: username:password@www.example.com:80/dir/dir/page.php?foo=bar&foo2=bar2#bookmark
scheme // http
host // www.example.com
port // 80
user // username
pass // password
path // /dir/dir/page.php
query // ? 'foo=bar&foo2=bar2'
fragment // # 'bookmark'
dir // /dir/dir
base // www.example.com/dir/dir
prev_dir // www.example.com/dir/
*/
if (!empty(this->url_segments['host'], this->trigger_error('You are only allowed to browse these websites: ' . implode(', ', this->trigger_error('Please supply a valid URL');
}
}