xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Iterator
  • MultiByte

Class MultiByte

Shared multi-byte character set implementation based on the PHP Multi-byte String Extension.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Charset
Extended by Core\Charset\MultiByte

Direct known subclasses

Core\Charset\Driver\sjis, Core\Charset\Driver\utf16, Core\Charset\Driver\utf16be, Core\Charset\Driver\utf16le, Core\Charset\Driver\utf32, Core\Charset\Driver\utf32be, Core\Charset\Driver\utf32le, Core\Charset\Driver\utf8

Abstract
Namespace: Core\Charset
Package: Core\Charset
Since: 3.1
Requires: PHP 5.3, MBString
Version: 1.0
Located at Charset/MultiByte.inc.php

Methods summary

public
# __construct( )

Throws

Core\Exception\Configuration
PHP Multi-byte String extension not available.

Since

3.1
public string
# convertFromUTF8( string $string )

Converts a string encoded in UTF-8 to the current character set.

Converts a string encoded in UTF-8 to the current character set.

Parameters

$string
UTF-8 encoded source string.

Returns

string
Converted string in character set of current instance.

Since

3.1
public string
# convertToUTF8( string $string )

Converts a string encoded in the character set of this instance to UTF-8.

Converts a string encoded in the character set of this instance to UTF-8.

Parameters

$string
String encoded in this character set.

Returns

string
String converted from this character set to UTF-8.

Since

3.1
public
# len( $string )

Calculates the length in characters of a given string.

Calculates the length in characters of a given string.

Parameters

$string
to return length in characters for.

Since

3.1
public string
# pad( string $string, integer $length, string $padding, integer $flags, string $truncationMarker = null )

Fits a string by padding or truncation to a desired length. Padding uses characters from from an optional padding string.

Fits a string by padding or truncation to a desired length. Padding uses characters from from an optional padding string.

Parameters

$string
Source string to fit desired length.
$length

Desired length in characters of source string. If negative or lower than the length of the source string, the string is truncated; if equal to the length of the source string, it is returned unchanged.

$padding

String used as padding. If required padding is shorter than this string, only the leading part will be used.

$flags
Padding flags.
$truncationMarker

Optional marker string appended to the source string if truncated. If not defined or null, no truncation marker is used.

Returns

string
Fitted (padded or truncated) variant of the source string.

Since

3.1
public string
# sub( string $string, integer $from, integer $length = null )

Returns a substring of a given string.

Returns a substring of a given string.

Parameters

$string
Source string to return substring from.
$from

Zero-based start position of the substring to return.If negative, the start position is calculated from the end of the string. If the start position equals or exceeds the length of the string, false is returned instead.

$length

Optional maximum length of substring to return. If negative, the length is calculated from the total length of the string minus start position and length parameter (ie. up to a given number of characters before the end of the string). If omitted or null, the remaining string length is used instead. A value of false or 0 will return an empty string.

Returns

string
Substring extracted from the source string.

Since

3.1
public string
# toLower( string $string )

Transforms a given string to lowercase based on Unicode character properties with respect to this character set.

Transforms a given string to lowercase based on Unicode character properties with respect to this character set.

Parameters

$string
String to transform to lowercase.

Returns

string
Transformed lowercase variant of source string.

Since

3.1
public string
# toUpper( string $string )

Transforms a given string to uppercase based on Unicode character properties with respect to this character set.

Transforms a given string to uppercase based on Unicode character properties with respect to this character set.

Parameters

$string
String to transform to uppercase.

Returns

string
Transformed uppercase variant of source string.

Since

3.1
public string
# truncate( string $string, integer $start, integer $width, string $marker = null )

Truncates a string based on the desired visual width of the string.

Truncates a string based on the desired visual width of the string.

Parameters

$string
String to truncate.
$start
Immutable offset of characters that are never truncated.
$width
The desired (visible) width of the remainder after the start position.
$marker
Optional marker string appended to the string on truncation.

Returns

string
String with a maximum number of start offset + width visible characters.

Since

3.1
public integer
# width( string $string )

Returns the visible length of a given string.

Returns the visible length of a given string.

Parameters

$string
String to return width of.

Returns

integer
The standard character width visible width of the string.

Since

3.1

Methods inherited from Core\Charset

_restoreEnvironment(), _setupEnvironment(), activate(), active(), alias(), all(), convertFrom(), convertFromActive(), convertTo(), convertToActive(), convertUCS2ToUTF8(), convertUTF8ToUCS2(), format(), get(), hash(), iterator(), registerAlias(), sizeof(), vformat(), xmlSpecials()

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Charset

ACK, BEL, BS, CAN, CR, CRLF, DEL, DLE, DoubleQuotesFlag, EM, ENQ, EOT, ESC, ETB, ETX, FF, FS, GS, LF, LeftPadFlag, NAK, NUL, NoQuotesFlag, RS, RightPadFlag, SI, SO, SOH, STX, SUB, SYN, SingleQuotesFlag, TAB, TruncatePadFlag, US, VT

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

Properties inherited from Core\Charset

$_activeInstance, $_aliasMap, $_instances, $_v_displayName, $_v_name

Magic properties inherited from Core\Charset

$displayName, $name

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen