PHP Класс App\Libraries\Str

Наследование: extends Illuminate\Support\Str
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
head ( $value, integer $limit = 100, string $end = '...' ) : string Returns the input string shrunk to the limit size, by cutting in the end (tail).
head_and_tail ( $value, integer $limit = 100, string $mid = '...' ) : string Returns the input string shrunk to the limit size, by cutting in the middle.
isBoolean ( $str ) : boolean Evaluate the input string and returns true if it can be converted to a boolean.
isNullOrEmptyString ( $question ) : boolean Return true if the trim'ed value is unset, null or empty.
tail ( $value, integer $limit = 100, string $start = '...' ) : string Returns the input string shrunk to the limit size, by cutting in the start (head).
toBoolean ( $str ) : boolean Converts the input string to it's boolean representation.

Описание методов

head() публичный статический метод

The start (head) of a string will be returned with an ellipsis after it where the text is cut.
public static head ( $value, integer $limit = 100, string $end = '...' ) : string
$value
$limit integer
$end string
Результат string

head_and_tail() публичный статический метод

The start (head) and end (tail) of a string will be returned with an ellipsis between them where the text is cut.
public static head_and_tail ( $value, integer $limit = 100, string $mid = '...' ) : string
$value
$limit integer
$mid string
Результат string

isBoolean() публичный статический метод

Evaluate the input string and returns true if it can be converted to a boolean.
public static isBoolean ( $str ) : boolean
$str
Результат boolean

isNullOrEmptyString() публичный статический метод

Modification from: http://stackoverflow.com/a/381275 Author: Michael Haren (http://stackoverflow.com/users/29/michael-haren)
public static isNullOrEmptyString ( $question ) : boolean
$question
Результат boolean

tail() публичный статический метод

The end (tail) of a string will be returned with an ellipsis before it where the text is cut.
public static tail ( $value, integer $limit = 100, string $start = '...' ) : string
$value
$limit integer
$start string
Результат string

toBoolean() публичный статический метод

Converts the input string to it's boolean representation.
public static toBoolean ( $str ) : boolean
$str
Результат boolean