[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

(no description)

File Size: 383 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

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

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 - It's
even faster than mb_strlen.

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

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

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

author: Harry Fuecks <hfuecks@gmail.com>
author: Chris Smith <chris@jalakai.co.uk>
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
return: string

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

see: substr_replace()
author: Andreas Gohr <andi@splitbrain.org>
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
return: string

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

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

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

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

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

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

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

Uses mb_string extension if available

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

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

Uses mb_string extension if available

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

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

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

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

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

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