Urgent, online and so on, Saturday Sunday are working overtime to get this problem, how to get the length of the uploaded image width
How to get the length and width of the uploaded image
List ($width, $height, $type, $attr) = getimagesize (' http://192.168.254.20/Public/images/0.jpg ');
Echo $width;
Echo $height;
Echo $attr;
$img = Imagecreatefromjpeg ("http://http://192.168.254.20/Public/images/0.jpg");
echo Imagesx ($img);
echo "Imagesy ($img)";
Exit
Neither of these methods is working, and no data is output. The picture path is right, you can open the picture
------to solve the idea----------------------
The first method is possible, and you suspect that there is a problem with your path.
List ($width, $height, $type, $attr) = getimagesize (' http://avatar.csdn.net/1/9/2/1_mengfk000.jpg ');
Print_r ($width); echo "
";
Print_r ($height); echo "
";
Print_r ($attr); echo "
";
------to solve the idea----------------------
Open the error message function of PHP.
If the picture can be opened, at least the second one is output. The first one is because getimagesize (
' http://192.168.254.20/public/images/0.jpg '); There are spaces in front of the path.
------to solve the idea----------------------
Print_r (getimagesize (' http://avatar.csdn.net/1/9/2/1_mengfk000.jpg '));
Array
(
[0] = 150
[1] = 150
[2] = 2
[3] = width= "height=" 150 "
[Bits] = 8
[Channels] = 3
[MIME] = Image/jpeg
)