简体   繁体   中英

getimagesize () command problem! Loop promlem in command getimagesize ()

getimagesize () command in the For loop and the Foreach loop gives the same erroneous result. I just couldn't fix it. What is the reason for this, how can I fix it? I take the picture files from the same folder, but it always just gives the last one. When I apply the command one by one to the pictures, there is no problem, but when I loop, why am I having problems Also the pictures are a bit big. If this is the case, how can I make the loop synchronize with the command?

the command is as follows;

$file = file_get_contents("sss.txt");
$files = explode("\n", $file);

foreach( $files as $Xfile ) {

list($width, $height, $type, $attr) = getimagesize('ebat_al/'.$Xfile);
echo "genislik = " . $width . "<br>";
echo "yükseklik = " . $height . "<br>";

}

/*

The results are always like;

genislik =

yükseklik =

genislik =

yükseklik =

genislik =

yükseklik =

genislik =

yükseklik =

genislik = 5000

yükseklik = 5000

I would be glad if you could help.

I also said I would upload it to the web server and try it and it worked fine. but why is my wamp not working? What could be the reason for this?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM