2012-05-23 54 views

回答

1

假設你可以看到在瀏覽器中的圖像。 因此,首先,您需要獲取圖像鏈接包含的網址。

爲了得到這個,你應該簡單地分析被查看頁面的內容並且執行像這樣的規則表達匹配;

<?php 

ob_start(); 

$content = ob_get_contents(); 

    function find_all_img_url_in_cur_page(){ 
     global $content; 

     $result = array(); 

     if (preg_match('/jpg/i', $content)){ 
     //find postion and add into array 
     } 
     return $result; 
    } 

    find_all_img_url_in_cur_page(); 

    ob_end_clean(); 
    ?> 

那麼你需要複製/打開目前你正在處理的這個IMG文件(使用通常與php捆綁的標準GD庫)。

Google for「image resize with php」,所以當你得到你想要的東西后

相關問題