I dont understand the function of these characters
-> in this code:
the function "getImageInfo()" populates the variable "$var".
I can use the print_r function to display all values but how do I get a specific value
echo "<pre>"; print_r($var->getImageInfo()); echo "</pre>";
Array ( [resolutionUnit] => 0 [fileName] => 1.jpg [fileSize] => 30368 bytes ... )
how do I get "fileSize" for instance?
In your example,
$var->getImageInfo(), the variable
$var is an instance (also called an object) of a class. The function
getImageInfo() is known as a class method. This is part of Object Oriented Programming, also called OOP. You can learn more about this here - http://php.net/manual/en/language.oop5.php
If you want to get a particular member of the array that you listed, you can simply do:
$image_info = $var->getImageInfo(); echo $image_info['fileSize'];
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki