• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

PHP connection_status function – Returns connection status bitfield

by admin

Description

The connection_status() function takes no parameters and returns 0 if the connection is live and execution is still taking place; 1 if the connection is aborted; 2 if the connection has been aborted; and 3 if the connection has been aborted and subsequently timed out.

Syntax:

connection_status(): int

The values 0, 1, 2, and 3 evaluate to the constants CONNECTION_NORMAL, CONNECTION_ABORTED, CONNECTION_TIMEOUT, and CONNECTION_ABORTED | CONNECTION_TIMEOUT (a bitwise OR of the previous two).

Parameters

This function has no parameters.

Return Values

Returns the connection status bitfield, which can be used against the CONNECTION_XXX constants to determine the connection status.

Filed Under: PHP

Some more articles you might also be interested in …

  1. How to test a PHP script
  2. PHP addslashes function – Quote string with slashes
  3. PHP function chr() – Generate a single-byte string from a number
  4. PHP Function strchr() – Alias of strstr()
  5. PHP base_convert function – Convert a number between arbitrary bases
  6. PHP atan2 function – Arc tangent of two variables
  7. PHP ceil function – Round fractions up
  8. PHP function strcasecmp() – Binary safe case-insensitive string comparison
  9. PHP decbin function – Decimal to binary
  10. PHP function bin2hex – Convert binary data into hexadecimal representation

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright