[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Utf8/ -> PhpString.php (summary)

(no description)

File Size: 373 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PhpString:: (12 methods):
  basename()
  strlen()
  substr()
  substr_replace()
  ltrim()
  rtrim()
  trim()
  strtolower()
  strtoupper()
  ucfirst()
  ucwords()
  strpos()


Class: PhpString  - X-Ref

UTF-8 aware equivalents to PHP's string functions

basename($path, $suffix = '')   X-Ref
A locale independent basename() implementation

works around a bug in PHP's basename() implementation

return: string
see: basename()
param: string $path A path
param: string $suffix If the name component ends in suffix this will also be cut off
link: https://bugs.php.net/bug.php?id=37738

strlen($string)   X-Ref
Unicode aware replacement for strlen()

utf8_decode() converts characters that are not in ISO-8859-1
to '?', which, for the purpose of counting, is alright

return: int
see: utf8_decode()
see: strlen()
param: string $string
author: <chernyshevsky at hotmail dot com>

substr($str, $offset, $length = null)   X-Ref
UTF-8 aware alternative to substr

Return part of a string given character offset (and optionally length)

return: string
param: string $str
param: int $offset number of UTF-8 characters offset (from left)
param: int $length (optional) length in UTF-8 characters from offset
author: Harry Fuecks <hfuecks@gmail.com>
author: Chris Smith <chris@jalakai.co.uk>

substr_replace($string, $replacement, $start, $length = 0)   X-Ref
Unicode aware replacement for substr_replace()

return: string
see: substr_replace()
param: string $string input string
param: string $replacement the replacement
param: int $start the replacing will begin at the start'th offset into string.
param: int $length If given and is positive, it represents the length of the portion of string which is
author: Andreas Gohr <andi@splitbrain.org>

ltrim($str, $charlist = '')   X-Ref
Unicode aware replacement for ltrim()

return: string
see: ltrim()
param: string $str
param: string $charlist
author: Andreas Gohr <andi@splitbrain.org>

rtrim($str, $charlist = '')   X-Ref
Unicode aware replacement for rtrim()

return: string
see: rtrim()
param: string $str
param: string $charlist
author: Andreas Gohr <andi@splitbrain.org>

trim($str, $charlist = '')   X-Ref
Unicode aware replacement for trim()

return: string
see: trim()
param: string $str
param: string $charlist
author: Andreas Gohr <andi@splitbrain.org>

strtolower($string)   X-Ref
This is a unicode aware replacement for strtolower()

Uses mb_string extension if available

return: string
see: \dokuwiki\Utf8\PhpString::strtoupper()
see: strtolower()
param: string $string
author: Leo Feyer <leo@typolight.org>

strtoupper($string)   X-Ref
This is a unicode aware replacement for strtoupper()

Uses mb_string extension if available

return: string
see: \dokuwiki\Utf8\PhpString::strtoupper()
see: strtoupper()
param: string $string
author: Leo Feyer <leo@typolight.org>

ucfirst($str)   X-Ref
UTF-8 aware alternative to ucfirst
Make a string's first character uppercase

return: string with first character as upper case (if applicable)
param: string $str
author: Harry Fuecks

ucwords($str)   X-Ref
UTF-8 aware alternative to ucwords
Uppercase the first character of each word in a string

return: string with first char of each word uppercase
see: http://php.net/ucwords
param: string $str
author: Harry Fuecks

strpos($haystack, $needle, $offset = 0)   X-Ref
No description