Oihana PHP

isWeb.php

Table of Contents

Functions

isWeb()  : bool
Checks if the PHP script is running in a Web server context (not CLI).

Functions

isWeb()

Checks if the PHP script is running in a Web server context (not CLI).

isWeb() : bool

Returns true if PHP is executed via HTTP (e.g., Slim, Symfony HTTP, WordPress).

Tags
example
use function oihana\core\env\isWeb;

if (isWeb())
{
   echo "Web mode\n";
}
author

Marc Alcaraz

since
1.0.0
Return values
bool

true if the script is running in a web context, false otherwise


        
On this page

Search results