Example 1 — Read the Protocol Version
Connect and print mysqli_get_proto_info() from a typical sample.
<?php
$mysqli = mysqli_connect("localhost", "demo", "secret", "shop");
echo mysqli_get_proto_info($mysqli), PHP_EOL;
mysqli_close($mysqli); How It Works
- A demo connection is opened.
- mysqli_get_proto_info() returns the protocol number.
- 10 is the common modern sample value.
- The connection is closed afterward.

