Wrapper over php string functions with a consistent argument system

 Methods

Return output from the last method

_() : mixed

Returns

mixed

Constructor

__construct(string $string) : \PHPUtil\Str

Parameters

$string

string

Returns

Enable using the object as a function

__invoke(string $string) : \PHPUtil\$this

Parameters

$string

string

Returns

\PHPUtil\$this

Output from the last method

__toString() : string

Returns

string

Formats a string according to the pattern passed to the str() function

format(array $replacements) : \PHPUtil\$this

see \PHPUtil\http://php.net/manual/function.sprintf.php

Parameters

$replacements

array

Returns

\PHPUtil\$this

Check whether a string matches the provided pattern

match(string $pattern) : bool

Parameters

$pattern

string

Returns

bool

String replacement via a regular expression

reg_replace(mixed $pattern, mixed $replacement) : \PHPUtil\$this

see \PHPUtil\http://php.net/manual/function.preg-replace.php

Parameters

$pattern

mixed

$replacement

mixed

Returns

\PHPUtil\$this

Do a basic string replacement

replace(mixed $pattern, mixed $replacement) : \PHPUtil\$this

see \PHPUtil\http://php.net/manual/function.str-replace.php

Parameters

$pattern

mixed

$replacement

mixed

Returns

\PHPUtil\$this

 Properties

 

Original string to be modified

$original : string