if ($action == 'save_cat') {
    //echo '$remote_url:'.$remote_url;
    if (empty($_REQUEST['remote_url'])) {
        die('empty remote url.');
    }
    $html_content = trim(file_get_contents($remote_url));
    //点击分类,产品列表页面匹配产品的url
    $preg_url = '#<h2>\\s+<a\\s+href="([^"]+)"\\s+class="ih"#';
    preg_match_all($preg_url, $html_content, $url_arr);
    //echo "<pre>";print_r($url_arr);exit;
    if (empty($url_arr[1])) {
        echo "not found products url.";
        exit;
    }
    //echo "dddddddddddddddd";exit;
    createDirIfNotExists2($cache_url);
    $content = implode("\n", $url_arr[1]);
    file_put_contents($cache_url, $content);
    echo 'success save products url';
    outputForm();
    //die('success save products url');
}
//在缓存文件中获取一个url
$urls_arr = file($cache_url);
$tmp = array();
foreach ($urls_arr as $key => $val) {
    $val = trim($val);
    $val = preg_replace("#\\\n#", "", $val);
    $val = preg_replace("#^\\s+|\\s+\$#", "", $val);
    if (!empty($val)) {
        $tmp[] = $val;
function saveIronImage($get_url, $save_url)
{
    createDirIfNotExists2($save_url);
    $img_content = file_get_contents($get_url);
    file_put_contents($save_url, $img_content);
    resizeimage($save_url, 350);
}