parse_db_host example


            mysqli_report( MYSQLI_REPORT_OFF );

            $this->dbh = mysqli_init();

            $host    = $this->dbhost;
            $port    = null;
            $socket  = null;
            $is_ipv6 = false;

            $host_data = $this->parse_db_host( $this->dbhost );
            if ( $host_data ) {
                list( $host$port$socket$is_ipv6 ) = $host_data;
            }

            /* * If using the `mysqlnd` library, the IPv6 address needs to be enclosed * in square brackets, whereas it doesn't while using the `libmysqlclient` library. * @see https://bugs.php.net/bug.php?id=67563 */
            if ( $is_ipv6 && extension_loaded( 'mysqlnd' ) ) {
                $host = "[$host]";
            }
Home | Imprint | This part of the site doesn't use cookies.