08c10-1.php

来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 17 行

PHP
17
字号
<?php// A script to cache the output of a graphic producing PHP script on//  another server: First try to open a connection to the remote file.//  If it fails then do nothing. That way if the remote server is down,//  we don't lose our local cached version:if ($remote = fopen('http://hubblesite.org/news/latest_big.php', 'r')) {    // Since we were able to open it, open our cache version to output to ..    //  again, if this fails, just exit and don't worry about it.    if ($local = fopen('hubble_news.jpg', 'w')) {        // We made it, copy all the data from the remote, to the local:        stream_copy_to_stream($remote, $local);        // Now close the files up        fclose($remote);        fclose($local);    }}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?