CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.5 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.5
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • I18n
  • L10n
  • Multibyte

Class Multibyte

Multibyte handling methods.

Package: Cake\I18n
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/I18n/Multibyte.php

Properties summary

  • $_caseFold protected static
    array
    Holds the case folding values
  • $_codeRange protected static
    array
    Holds an array of Unicode code point ranges
  • $_table protected static
    string
    Holds the current code point range

Method Summary

  • _codepoint() protected static
    Return the Code points range for Unicode characters
  • _find() protected static
    Find the related code folding values for $char
  • ascii() public static

    Converts the decimal value of a multibyte character string to a string

  • checkMultibyte() public static
    Check the $string for multibyte characters
  • mimeEncode() public static
    Prepare a string for mail transport, using the provided encoding
  • stripos() public static
    Find position of first occurrence of a case-insensitive string.
  • stristr() public static
    Finds first occurrence of a string within another, case insensitive.
  • strlen() public static
    Get string length.
  • strpos() public static
    Find position of first occurrence of a string.
  • strrchr() public static
    Finds the last occurrence of a character in a string within another.
  • strrichr() public static
    Finds the last occurrence of a character in a string within another, case insensitive.
  • strripos() public static
    Finds position of last occurrence of a string within another, case insensitive
  • strrpos() public static
    Find position of last occurrence of a string in a string.
  • strstr() public static
    Finds first occurrence of a string within another
  • strtolower() public static
    Make a string lowercase
  • strtoupper() public static
    Make a string uppercase
  • substr() public static
    Get part of string
  • substrCount() public static
    Count the number of substring occurrences
  • utf8() public static

    Converts a multibyte character string to the decimal value of the character

Method Detail

_codepoint() protected static ¶

_codepoint( integer $decimal )

Return the Code points range for Unicode characters

Parameters
integer $decimal
Decimal value.
Returns
string

_find() protected static ¶

_find( integer $char , string $type = 'lower' )

Find the related code folding values for $char

Parameters
integer $char
decimal value of character
string $type optional 'lower'
Type 'lower' or 'upper'. Defaults to 'lower'.
Returns
array|null

ascii() public static ¶

ascii( array $array )

Converts the decimal value of a multibyte character string to a string

Parameters
array $array
Values array.
Returns
string

checkMultibyte() public static ¶

checkMultibyte( string $string )

Check the $string for multibyte characters

Parameters
string $string
Value to test.
Returns
boolean

mimeEncode() public static ¶

mimeEncode( string $string , string $charset = null , string $newline = "\r\n" )

Prepare a string for mail transport, using the provided encoding

Parameters
string $string
value to encode
string $charset optional null
charset to use for encoding. defaults to UTF-8
string $newline optional "\r\n"
Newline string.
Returns
string

stripos() public static ¶

stripos( string $haystack , string $needle , integer $offset = 0 )

Find position of first occurrence of a case-insensitive string.

Parameters
string $haystack
The string from which to get the position of the first occurrence of $needle.
string $needle
The string to find in $haystack.
integer $offset optional 0
The position in $haystack to start searching.
Returns
integer|boolean

The numeric position of the first occurrence of $needle in the $haystack string, or false if $needle is not found.


stristr() public static ¶

stristr( string $haystack , string $needle , boolean $part = false )

Finds first occurrence of a string within another, case insensitive.

Parameters
string $haystack
The string from which to get the first occurrence of $needle.
string $needle
The string to find in $haystack.
boolean $part optional false

Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is false.

Returns
integer|boolean
The portion of $haystack, or false if $needle is not found.

strlen() public static ¶

strlen( string $string )

Get string length.

Parameters
string $string
The string being checked for length.
Returns
integer
The number of characters in string $string

strpos() public static ¶

strpos( string $haystack , string $needle , integer $offset = 0 )

Find position of first occurrence of a string.

Parameters
string $haystack
The string being checked.
string $needle
The position counted from the beginning of haystack.
integer $offset optional 0
The search offset. If it is not specified, 0 is used.
Returns
integer|boolean

The numeric position of the first occurrence of $needle in the $haystack string. If $needle is not found, it returns false.


strrchr() public static ¶

strrchr( string $haystack , string $needle , boolean $part = false )

Finds the last occurrence of a character in a string within another.

Parameters
string $haystack
The string from which to get the last occurrence of $needle.
string $needle
The string to find in $haystack.
boolean $part optional false

Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle. If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.

Returns
string|boolean
The portion of $haystack. or false if $needle is not found.

strrichr() public static ¶

strrichr( string $haystack , string $needle , boolean $part = false )

Finds the last occurrence of a character in a string within another, case insensitive.

Parameters
string $haystack
The string from which to get the last occurrence of $needle.
string $needle
The string to find in $haystack.
boolean $part optional false

Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle. If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.

Returns
string|boolean
The portion of $haystack. or false if $needle is not found.

strripos() public static ¶

strripos( string $haystack , string $needle , integer $offset = 0 )

Finds position of last occurrence of a string within another, case insensitive

Parameters
string $haystack
The string from which to get the position of the last occurrence of $needle.
string $needle
The string to find in $haystack.
integer $offset optional 0
The position in $haystack to start searching.
Returns
integer|boolean

The numeric position of the last occurrence of $needle in the $haystack string, or false if $needle is not found.


strrpos() public static ¶

strrpos( string $haystack , string $needle , integer $offset = 0 )

Find position of last occurrence of a string in a string.

Parameters
string $haystack
The string being checked, for the last occurrence of $needle.
string $needle
The string to find in $haystack.
integer $offset optional 0

May be specified to begin searching an arbitrary number of characters into the string. Negative values will stop searching at an arbitrary point prior to the end of the string.

Returns
integer|boolean

The numeric position of the last occurrence of $needle in the $haystack string. If $needle is not found, it returns false.


strstr() public static ¶

strstr( string $haystack , string $needle , boolean $part = false )

Finds first occurrence of a string within another

Parameters
string $haystack
The string from which to get the first occurrence of $needle.
string $needle
The string to find in $haystack
boolean $part optional false

Determines which portion of $haystack this function returns. If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is FALSE.

Returns
string|boolean
The portion of $haystack, or true if $needle is not found.

strtolower() public static ¶

strtolower( string $string )

Make a string lowercase

Parameters
string $string
The string being lowercased.
Returns
string
with all alphabetic characters converted to lowercase.

strtoupper() public static ¶

strtoupper( string $string )

Make a string uppercase

Parameters
string $string
The string being uppercased.
Returns
string
with all alphabetic characters converted to uppercase.

substr() public static ¶

substr( string $string , integer $start , integer $length = null )

Get part of string

Parameters
string $string
The string being checked.
integer $start
The first position used in $string.
integer $length optional null
The maximum length of the returned string.
Returns
string
The portion of $string specified by the $string and $length parameters.

substrCount() public static ¶

substrCount( string $haystack , string $needle )

Count the number of substring occurrences

Parameters
string $haystack
The string being checked.
string $needle
The string being found.
Returns
integer
The number of times the $needle substring occurs in the $haystack string.

utf8() public static ¶

utf8( string $string )

Converts a multibyte character string to the decimal value of the character

Parameters
string $string
String to convert.
Returns
array

Properties detail

$_caseFold ¶

protected static array

Holds the case folding values

array()

$_codeRange ¶

protected static array

Holds an array of Unicode code point ranges

array()

$_table ¶

protected static string

Holds the current code point range

null
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs