Skip to content

Instantly share code, notes, and snippets.

@Bugfighter
Bugfighter / is_cli.php
Created April 26, 2024 21:10
Check for CLI script call.
<?php
/**
* This function checks on various environments for script call via CLI.
**/
function is_cli()
{
if ( defined('STDIN') )
{
return true;