PHP | Imagick getRegistry() Function
Last Updated :
28 Nov, 2019
The Imagick::getRegistry() function is an inbuilt function in PHP which is used to get the StringRegistry entry for the named key or false if not set.
Syntax:
string Imagick::getRegistry( string $key )
Parameters: This function accepts a single parameter $key which holds the key.
Return Value: This function returns a string value containing the value associated with the key.
Exceptions: This function throws ImagickException on error.
Below given programs illustrate the Imagick::getRegistry() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$registry = $imagick ->getRegistry( 'key' );
echo $registry ;
?>
|
Output:
// Empty string because no registry with key as 'key' is set.
Program 2:
<?php
$imagick = new Imagick(
$imagick ->setRegistry( 'key' , 'my_value' );
$registry = $imagick ->getRegistry( 'key' );
echo $registry ;
?>
|
Output:
my_value
Reference: https://www.php.net/manual/en/imagick.getregistry.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...