Search
 
SCRIPT & CODE EXAMPLE
 

PHP

display PHP errors based on environment variable

<?php
 
if(!defined('ENVIRONMENT')){
    define('ENVIRONMENT', 'DEVELOPMENT');
}
 
if (defined('ENVIRONMENT')) {
 
    switch (ENVIRONMENT) {
        case 'DEVELOPMENT':
            ini_set('display_errors', 1);
            ini_set('display_startup_errors', 1);
            error_reporting(E_ALL|E_STRICT);
            break;
 
        case 'PRODUCTION':
            error_reporting(0);
            break;
 
        default:
            exit('The application environment is not set correctly.');
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: Laravel To determine if an item is not present in the session 
Php :: how to get many of quensation php programming language 
Php :: session flash data (old input) 
Php :: how to convert php code to a string 
Php :: cara looping abjad with array 
Php :: How to programmatically grab the product description in WooCommerce? 
Php :: if ip in the array redirect php 
Php :: easyadminbundle 4 $this-get(EntityRepository::class) error 
Php :: PHP (php 7.3.5) sample 
Php :: laravel app not loading on server 
Php :: import csv in laravel 
Php :: extract date from datetime object in php 
Php :: how use same method in another class in laravel 
Php :: 150 charachter display only php 
Php :: PHP Superglobal - $_POST 
Php :: how to give dynamic value in onlick in php 
Php :: array_map with user functions php and parameter php 
Php :: how to download file in laravel 8 delelete from directry 
Php :: Delete Collection (Get) 
Php :: how to stop message of laravel mix 
Php :: check file extension in php 
Php :: Undefined offset: 0 at laravelframeworksrcIlluminateRoutingRouter.php 
Php :: automatically create html page using php and mysql 
Php :: searching for new lines 
Php :: laravel where has relation 
Php :: doiffernce between text and string in laravel migration 
Php :: laravel filemanger choose multiple images 
Php :: base64_decode 
Php :: apache/2.4.52 (win64) openssl/1.1.1m php/8.1.2 server at localhost port 80 
Php :: laravel collection unique 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =