<?php
//示例路径:/list/1.html
function put_contents($url){
        $root=&#39;http://&#39;.$_SERVER['HTTP_HOST'];
        $urls=explode(&#39;/&#39;,$url);
        $g_url=SITE_PATH;
        foreach($urls&nbsp;as&nbsp;$k=>$v){
            if($v&amp;&amp;strpos($v,'.html') !== false){
                if($g_url&amp;&amp;!file_exists($g_url)){
                    mkdir($g_url,0777,true);
                }
                $url&nbsp;=&nbsp;file_get_contents($root.$url);
                if($k==1){
                    $g_url=&#39;./&#39;.$v;
                    $index&nbsp;=&nbsp;fopen($g_url, "w");
                    fwrite($index,&nbsp;$url);
                    fclose($index);
                }else{
                    $g_url=$g_url.'/'.$v;
                    $index&nbsp;=&nbsp;fopen($g_url, "w");
                    fwrite($index,&nbsp;$url);
                    fclose($index);
                }
            }else{
                if($k==1){
                    $g_url=$v;
                }else{
                    $g_url=$g_url.'/'.$v;
                }
            }
        }
    }
?>