FileAccess Orion

StringWrapperInterface

Table of Contents

convert()  : string|false
Convert a string from defined encoding to the defined convert encoding
getConvertEncoding()  : string|null
Get the defined character encoding to convert to (upper case)
getEncoding()  : string
Get the defined character encoding to work with (upper case)
getSupportedEncodings()  : array<string|int, string>
Get a list of supported character encodings
isSupported()  : mixed
Check if the given character encoding is supported by this wrapper and the character encoding to convert to is also supported.
setEncoding()  : StringWrapperInterface
Set character encoding working with and convert to
strlen()  : int|false
Returns the length of the given string
strPad()  : string
Pad a string to a certain length with another string
strpos()  : int|false
Find the position of the first occurrence of a substring in a string
substr()  : string|false
Returns the portion of string specified by the start and length parameters
wordWrap()  : string
Wraps a string to a given number of characters

Methods

convert()

Convert a string from defined encoding to the defined convert encoding

public convert(string $str[, bool $reverse = false ]) : string|false
Parameters
$str : string
$reverse : bool = false
Return values
string|false

getConvertEncoding()

Get the defined character encoding to convert to (upper case)

public getConvertEncoding() : string|null
Return values
string|null

getEncoding()

Get the defined character encoding to work with (upper case)

public getEncoding() : string
Return values
string

getSupportedEncodings()

Get a list of supported character encodings

public static getSupportedEncodings() : array<string|int, string>
Return values
array<string|int, string>

isSupported()

Check if the given character encoding is supported by this wrapper and the character encoding to convert to is also supported.

public static isSupported(string $encoding[, string|null $convertEncoding = null ]) : mixed
Parameters
$encoding : string
$convertEncoding : string|null = null
Return values
mixed

setEncoding()

Set character encoding working with and convert to

public setEncoding(string $encoding[, string|null $convertEncoding = null ]) : StringWrapperInterface
Parameters
$encoding : string

The character encoding to work with

$convertEncoding : string|null = null

The character encoding to convert to

Return values
StringWrapperInterface

strlen()

Returns the length of the given string

public strlen(string $str) : int|false
Parameters
$str : string
Return values
int|false

strPad()

Pad a string to a certain length with another string

public strPad(string $input, int $padLength[, string $padString = ' ' ][, int $padType = STR_PAD_RIGHT ]) : string
Parameters
$input : string
$padLength : int
$padString : string = ' '
$padType : int = STR_PAD_RIGHT
Return values
string

strpos()

Find the position of the first occurrence of a substring in a string

public strpos(string $haystack, string $needle, int $offset) : int|false
Parameters
$haystack : string
$needle : string
$offset : int
Return values
int|false

substr()

Returns the portion of string specified by the start and length parameters

public substr(string $str, int $offset[, int|null $length = null ]) : string|false
Parameters
$str : string
$offset : int
$length : int|null = null
Return values
string|false

wordWrap()

Wraps a string to a given number of characters

public wordWrap(string $str[, int $width = 75 ][, string $break = " " ][, bool $cut = false ]) : string
Parameters
$str : string
$width : int = 75
$break : string = " "
$cut : bool = false
Return values
string

Search results