PHP password_get_info() Function Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report The password_get_info() is an inbuilt PHP function where detailed information regarding the given hash will be returned. Syntax: password_get_info(string $hash): arrayParameter: This function accepts a single parameter: hash: This parameter defines the hash of the password by creating the password_hash() function. Return Values: algo: This parameter define which type of password algorithm is used in the password.algoName: This parameter defines the name of the algorithm in human-readable form.options: This parameter includes the options provided when calling the password_hash() function.Example 1: The following code demonstrates the password_get_info() function. PHP <?php $a= password_hash("geeksforgeeks", PASSWORD_DEFAULT); var_dump(password_get_info($a)); ?> Output: array(3) { ["algo"]=> string(2) "2y" ["algoName"]=> string(6) "bcrypt" ["options"]=> array(1) { ["cost"]=> int(10) } } Example 2: The following code demonstrates the password_get_info() function. PHP <?php $password = "GeeksforGeeks"; $hashedPassword = password_hash($password, PASSWORD_DEFAULT); // Retrieve password information $passwordInfo = password_get_info($hashedPassword); // Display password information echo "Hash algorithm: " . $passwordInfo['algo'] . "\n"; echo "Hash strength: " . $passwordInfo['algoName'] . "\n"; ?> Output: Hash algorithm: 2y Hash strength: bcrypt Reference: https://www.php.net/manual/en/function.password-get-info.php Comment More infoAdvertise with us Next Article PHP password_get_info() Function neeraj3304 Follow Improve Article Tags : PHP PHP-function Similar Reads PHP | gd_info() Function The gd_info() function is an inbuilt function in PHP which is used to retrieve the information about the currently installed GD library. This function returns the information about the version and capabilities of the installed GD library. Syntax: array gd_info( void ) Parameters: This function does 2 min read PHP | IntlCalendar get() Function The IntlCalendar::get() function is an inbuilt function in PHP which is used to get the value for a specific field. Syntax: Object oriented style int IntlCalendar::get( int $field ) Procedural style int intlcal_get( IntlCalendar $cal, int $field ) Parameters: This function uses two parameters as men 2 min read PHP ob_get_length() Function The ob_get_length() function is an inbuilt function in PHP that is used to get the length of the current output buffer. The output buffer length is the number of bytes in the buffer. Syntax: ob_get_length(): int|falseParameters: This function does not accept any parameter. Return Values: The ob_get_ 2 min read PHP | getimagesize() Function The getimagesize() function in PHP is an inbuilt function which is used to get the size of an image. This function accepts the filename as a parameter and determines the image size and returns the dimensions with the file type and height/width of image. Syntax: array getimagesize( $filename, $image_ 2 min read PHP | gettimeofday() Function The gettimeofday() function is an inbuilt function in PHP which is used to return the current time. It is an interface to Unix system call gettimeofday(2). It returns an associative array containing the data returned from the system call. The float option is sent as a parameter to the gettimeofday() 2 min read PHP ob_get_level() Function The ob_get_level() function is an inbuilt function in PHP that is used to get the current output buffer level in a nested level. Output buffering is a feature in PHP that allows you to capture and manipulate output before it is sent to the browser or client. Syntaxob_get_level(): intParameter This f 2 min read PHP | getdate() Function The getdate() function is an inbuilt function in PHP which is used to get date/time information of the current local date/time. Syntax: getdate($timestamp) Parameters: The getdate() function accepts one parameter and it is described below: $timestamp: It is an optional parameter which specifies an i 2 min read PHP gettype() Function The PHP gettype() function returns the type of a variable as a string. It identifies the variable's data type, such as string, integer, array, boolean, etc., allowing developers to check and handle different data types dynamically.Syntax:string gettype ( $var )Parameter: This function accepts a sing 2 min read PHP | cal_info( ) Function The cal_info() function in PHP is an inbuilt function that is used to return information about a specified calendar. The cal_info() function returns an array that contains the calname, month, abbrevmonth and maxdaysinmonth, and calsymbol. It takes the calendar as a parameter and returns the informat 2 min read PHP | gethostname() Function The gethostname() function is an inbuilt function in PHP which returns the host or domain name for the local machine. This function is applicable after PHP 5.3.0 before that there was another function called php_uname function. Syntax: string gethostname( void ) Parameters: This function doesn't acc 1 min read Like