PHP code example of cerealean / php-common-utilities

1. Go to this page and download the library: Download cerealean/php-common-utilities library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cerealean / php-common-utilities example snippets


$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$address = $_POST['address'];

if(!empty($first_name) && !empty($last_name) && !empty($address)){
/* do something */
}

$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$address = $_POST['address'];

if(IsEmpty::none($first_name, $last_name, $address)){
/* do something */
}

/* Stuff done */

if(is_string($first_example) && is_string($second_example) && is_string('This is a string')){
/* Do more stuff */
}

/* Stuff done */

if(IsString::all($first_example, $second_example, 'This is a string')){
/* Do more stuff */
}

/* Do stuff */

if(is_readable($first_file) && is_readable($second_file)){
/* do stuff */
}

/* Do stuff and instantiate IsReadable into $is_readable */

if($is_readable->all($first_file, $second_file)){
/* Do stuff */
}