PHP 클래스 rex_string, redaxo

파일 보기 프로젝트 열기: redaxo/redaxo 1 사용 예제들

공개 메소드들

메소드 설명
buildAttributes ( array $attributes ) : string Returns a string by key="value" pair.
buildQuery ( array $params, string $argSeparator = '&' ) : string Generates URL-encoded query string.
highlight ( string $string ) : string Highlights a string.
normalize ( string $string, string $replaceChar = '_', string $allowedChars = '' ) : string Normalizes a string.
normalizeEncoding ( string $string ) : string Normalizes the encoding of a string (UTF8 NFD to NFC).
size ( string $string ) : integer Returns the string size in bytes.
split ( string $string ) : array Splits a string by spaces (Strings with quotes will be regarded).
versionCompare ( string $version1, string $version2, string $comparator = null ) : integer | boolean Compares two version number strings.
versionSplit ( string $version ) : array Splits a version string.
yamlDecode ( string $value ) : array Parses YAML into a PHP array.
yamlEncode ( array $value, integer $inline = 3 ) : string Returns a string containing the YAML representation of $value.

메소드 상세

buildAttributes() 공개 정적인 메소드

Returns a string by key="value" pair.
public static buildAttributes ( array $attributes ) : string
$attributes array
리턴 string

buildQuery() 공개 정적인 메소드

Generates URL-encoded query string.
public static buildQuery ( array $params, string $argSeparator = '&' ) : string
$params array
$argSeparator string
리턴 string

highlight() 공개 정적인 메소드

Highlights a string.
public static highlight ( string $string ) : string
$string string
리턴 string

normalize() 공개 정적인 메소드

Makes the string lowercase, replaces umlauts by their ascii representation (ä -> ae etc.), and replaces all other chars that do not match a-z, 0-9 or $allowedChars by $replaceChar.
public static normalize ( string $string, string $replaceChar = '_', string $allowedChars = '' ) : string
$string string Input string
$replaceChar string Character that is used to replace not allowed chars
$allowedChars string Character whitelist
리턴 string

normalizeEncoding() 공개 정적인 메소드

On HFS+ filesystem (OS X) filenames are stored in UTF8 NFD while all other filesystems are using UTF8 NFC. NFC is more common in general.
public static normalizeEncoding ( string $string ) : string
$string string Input string
리턴 string

size() 공개 정적인 메소드

Returns the string size in bytes.
public static size ( string $string ) : integer
$string string String
리턴 integer Size in bytes

split() 공개 정적인 메소드

Examples: "a b 'c d'" -> array('a', 'b', 'c d') "a=1 b='c d'" -> array('a' => 1, 'b' => 'c d')
public static split ( string $string ) : array
$string string
리턴 array

versionCompare() 공개 정적인 메소드

In contrast to version_compare() it treats "1.0" and "1.0.0" as equal and it supports a space as separator for the version parts, e.g. "1.0 beta1"
또한 보기: http://www.php.net/manual/en/function.version-compare.php
public static versionCompare ( string $version1, string $version2, string $comparator = null ) : integer | boolean
$version1 string First version number
$version2 string Second version number
$comparator string Optional comparator
리턴 integer | boolean

versionSplit() 공개 정적인 메소드

Splits a version string.
public static versionSplit ( string $version ) : array
$version string Version
리턴 array Version parts

yamlDecode() 공개 정적인 메소드

Parses YAML into a PHP array.
public static yamlDecode ( string $value ) : array
$value string YAML string
리턴 array

yamlEncode() 공개 정적인 메소드

Returns a string containing the YAML representation of $value.
public static yamlEncode ( array $value, integer $inline = 3 ) : string
$value array The value being encoded
$inline integer The level where you switch to inline YAML
리턴 string