Download the PHP package thomas-squall/string-utils without Composer
On this page you can find all versions of the php package thomas-squall/string-utils. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thomas-squall/string-utils
More information about thomas-squall/string-utils
Files in thomas-squall/string-utils
Package string-utils
Short Description Utilities for string management
License MIT
Informations about the package string-utils
String Utils for php
List of available functions
1) string_starts_with 2) string_ends_with 3) string_between 4) strings_between 5) string_contains
string_starts_with
Description
Returns true if the $haystack string starts with the $needle string.
Definition
string_starts_with($haystack, $needle)
Where: 1) $haystack is the string to look into 2) $needle is the string to check if the $haystack starts with
Usage
This will print:
string_ends_with
Description
Returns true if the $haystack string ends with the $needle string.
Definition
string_ends_with($haystack, $needle)
Where: 1) $haystack is the string to look into 2) $needle is the string to check if the $haystack starts with
Usage
This will print:
string_between
Description
Returns the first occurrence of the string between the $start and $end string from $string. False if nothing is found.
Definition
string_between($string, $start, $end, $empty_string = false)
Where: 1) $string is the string to look into 2) $start is the left string to search 3) $end is the right string to search 4) $empty_string determines whether return empty strings or not
Usage
This will print:
strings_between
Description
Returns the strings between the $start and $end string from $string. Empty array if nothing is found.
Definition
strings_between($string, $start, $end, $empty_strings = false)
Where: 1) $string is the string to look into 2) $start is the left string to search 3) $end is the right string to search 4) $empty_strings determines whether return empty strings or not
Usage
This will print:
string_contains
Description
True or false whether the string $needle is contained in the string $haystack or not.
Definition
string_contains($haystack, $needle)
Where: 1) $haystack is the string to look into 2) $needle is the string to check if the $haystack contains
Usage
This will print: