w3resource

PHP mysqli: get_client_info() function

mysqli_get_client_info() function / mysqli::get_client_info

The mysqli_get_client_info() function / mysqli::get_client_info returns the MySQL client library version.

Syntax:

Object oriented style

string mysqli::get_client_info ( void )

Procedural style

string mysqli_get_client_info ( mysqli $link )

Usage: Procedural style

mysqli_get_client_info(connection);

Parameter:

Name Description Required/Optional
connection Specifies the MySQL connection to use. Required

Return value:

A string that represents the MySQL client library version.

Version: PHP 5, PHP 7

Example:

<?php
echo mysqli_get_client_info();
?>

Output:

mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.27 $

See also

PHP Function Reference

Previous: get_charset
Next: get_client_stats



Follow us on Facebook and Twitter for latest update.

PHP: Tips of the Day

Getting all defined constants

To get all defined constants including those created by PHP use the get_defined_constants function:

Example:

<?php
$constants = get_defined_constants();
var_dump($constants); // pretty large list

Output:

array(2250) {
  ["E_ERROR"]=>
  int(1)
  ["E_RECOVERABLE_ERROR"]=>
  int(4096)
  ["E_WARNING"]=>
  .....
  .....
  resource(1) of type (stream)
  ["STDOUT"]=>
  resource(2) of type (stream)
  ["STDERR"]=>
  resource(3) of type (stream)
}

To get only those constants that were defined by your app call the function at the beginning and at the end of your script (normally after the bootstrap process):

<?php
$constants = get_defined_constants();
define("HELLO", "hello");
define("WORLD", "world");
$new_constants = get_defined_constants();
$myconstants = array_diff_assoc($new_constants, $constants);
var_export($myconstants);

Output:

array (
  'HELLO' => 'hello',
  'WORLD' => 'world',
)

It's sometimes useful for debugging

 





We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook