php, getimagesize

0 Cevap

In server is many pictures, they pictures have names with space, examples: home 3.png, my new car.jpg. And i need get all images sizes. Why getimagesize() show errors with those images?

Hata:

Warning: getimagesize(http://127.0.0.1/img 1.jpg) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found...

I resmi çalıştırırsanız: iyi bir tarayıcı her şeyi http://127.0.0.1/img 1.jpg (çok iyi bağlantı).

Tam kodu:

<?php
require_once('simple_html_dom.php');

$string = str_get_html('some text some text <img src = "http://127.0.0.1/img 1.jpg" /> text .... ');

foreach($string->find('img') as $e)
    $img[] = $e->src;

$img_1 = getimagesize($img[0]);
print_r($img_1);
?>

0 Cevap