PHP | Imagick getImageAttribute() Function
The Imagick::getImageAttribute() function is an inbuilt function in PHP which is used to get the named attribute of a key.
Syntax:
string Imagick::getImageAttribute( string $key )
Parameters: This function accepts single parameter $key which holds the key value in string format.
Return Value: This function returns a string value on success.
Below programs illustrate the Imagick::getImageAttribute() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$attribute = $imagick ->getImageAttribute( 'hello' );
echo $attribute ;
?>
|
Output:
Empty string as it is the default value.
Program 2:
<?php
$imagick = new Imagick(
$imagick ->setImageAttribute( 'hello' , 'world' );
$attribute = $imagick ->getImageAttribute( 'hello' );
echo $attribute ;
?>
|
Output:
world
Reference: https://www.php.net/manual/en/imagick.getimageattribute.php
Last Updated :
15 Nov, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...