PHP code example of syntatis / utils

1. Go to this page and download the library: Download syntatis/utils 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/ */

    

syntatis / utils example snippets


use function Syntatis\Utils\Val;

// Check if a value is blank or empty
Val::isBlank(''); // true
Val::isBlank(' '); // true
Val::isBlank('foo '); // false

// Check if a value is a valid email address
Val::isEmail('[email protected]'); // true
Val::isEmail('invalid-email'); // false

use function Syntatis\Utils\Str;

// Convert a string to camel case
Str::toCamelCase('foo_bar'); // fooBar

// Pluralize a word
Str::toPlural('apple'); // apples

// Check if a string starts with a specific substring
Str::startsWith('Hello, World!', 'Hello'); // true