PHP code example of hedii / helpers

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

    

hedii / helpers example snippets


$string = string_without('This is my name', ' is ');

// Thismy name

$string = string_without('This is my name', 'some string');

// This is my name

$string = string_before('This is my name', ' name');

// This is my

$string = string_before('This is my name', 'some string');

// false

$string = string_after('This is my name', 'This ');

// is my name

$string = string_after('This is my name', 'some string');

// false

$string = string_between('This is my name', 'This ', ' name');

// is my

$string = string_between('This is my name', 'some', ' string');

// false

$value = string_starts_with('This is my name', 'This');

// true

$value = string_ends_with('This is my name', 'name');

// true

$length = string_length('abcd');

// 4

$value = string_is('foo*', 'foobar');

// true

$value = string_is('baz*', 'foobar');

// false

$value = string_contains('This is my name', 'my');

// true

$value = string_contains('This is my name', ['some string', 'my']);

// true

$string = string_finish('this/string', '/');

// this/string/

$string = string_finish('this/string/', '/');

// this/string/

$string = string_random(40);

// 6a2531aabec1fda11b0e0d9eaeb17d7ebfe1cdc5

is_url('http://example.com');

// true

is_url('tel:+1-111-222-333');

// false

$basename = class_basename(\Hedii\Helpers\HelpersTest);

// HelpersTest

is_window_os();

// false