Using the fopen() Function
<?php
$fr = fopen("myfile.txt", 'r');
$fr = fopen("myfile.dat", 'ba+');
$fr = fopen("code.php", 'w+', true);
$fr = fopen("http://www.php.net/index.php", 'r');
$fr = fopen("ftp://ftp.php.net/index.php", 'r');
$url = "http://www.php.net/this is my invalid URL.php";
$url = urlencode($url);
$fr = fopen($url, 'r');
?>
Related examples in the same category