Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PHP Wrappers

A wrapper is a custom way to access remote resources. It is designed to look like accessing a file, on the file system, but using other drivers than the ones of the hard drive. It is based on a configuration string, which looks like a URL: ftp://www.site.com/file.txt, where the part before the :// is the protocol.

Among the predefined PHP wrappers, there are http://, ftp://, zlib://, phar://, rar://, expect://.

<?php

$html = file_get_content('http://www.php.net/');

?>

Documentation

See Also