OXID eShop CE  4.8.11
 All Classes Files Functions Variables Pages
oxStrMb Class Reference

Public Member Functions

 __construct ()
 strlen ($sStr)
 substr ($sStr, $iStart, $iLength=null)
 strpos ($sHaystack, $sNeedle, $iOffset=null)
 strstr ($sHaystack, $sNeedle)
 strtolower ($sString)
 strtoupper ($sString)
 htmlspecialchars ($sString)
 htmlentities ($sString)
 html_entity_decode ($sString)
 preg_split ($sPattern, $sString, $iLimit=-1, $iFlag=0)
 preg_replace ($aPattern, $sString, $sSubject, $iLimit=-1, $iCount=null)
 preg_match ($sPattern, $sSubject, &$aMatches=null, $iFlags=null, $iOffset=null)
 preg_match_all ($sPattern, $sSubject, &$aMatches=null, $iFlags=null, $iOffset=null)
 ucfirst ($sSubject)
 wordwrap ($sString, $iLength=75, $sBreak="\n", $blCut=null)
 recodeEntities ($sInput, $blToHtmlEntities=false, $aUmls=array(), $aUmlEntities=array())
 hasSpecialChars ($sStr)
 cleanStr ($sStr, $sCleanChr= ' ')
 jsonEncode ($data)
 strip_tags ($sString, $sAllowableTags= '')
 strrcmp ($sStr1, $sStr2)

Protected Attributes

 $_sEncoding = 'UTF-8'
 $_aUmls = array( "\xc3\xa4", "\xc3\xb6", "\xc3\xbc", "\xC3\x84", "\xC3\x96", "\xC3\x9C", "\xC3\x9F" )
 $_aUmlEntities = array('ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü', 'ß' )

Detailed Description

Class dealing with multibyte strings

Definition at line 6 of file oxstrmb.php.

Constructor & Destructor Documentation

oxStrMb::__construct ( )

Class constructor. The constructor is defined in order to be possible to call parent::__construct() in modules.

Returns
null;

Definition at line 33 of file oxstrmb.php.

Member Function Documentation

oxStrMb::cleanStr (   $sStr,
  $sCleanChr = ' ' 
)

Replaces special characters with passed char. Special chars are:
;

Parameters
string$sStrstring to cleanup
object$sCleanChrwhich character should be used as a replacement (default is empty space)
Returns
string

Definition at line 327 of file oxstrmb.php.

oxStrMb::hasSpecialChars (   $sStr)

Checks if string has special chars

Parameters
string$sStrstring to search in
Returns
bool

Definition at line 313 of file oxstrmb.php.

oxStrMb::html_entity_decode (   $sString)

PHP html_entity_decode() function wrapper

Parameters
string$sStringstring being converted
Returns
string

Definition at line 155 of file oxstrmb.php.

oxStrMb::htmlentities (   $sString)

PHP htmlentities() function wrapper

Parameters
string$sStringstring being converted
Returns
string

Definition at line 143 of file oxstrmb.php.

oxStrMb::htmlspecialchars (   $sString)

PHP htmlspecialchars() function wrapper

Parameters
string$sStringstring being converted
Returns
string

Definition at line 131 of file oxstrmb.php.

oxStrMb::jsonEncode (   $data)

wrapper for json encode, which does not work with non utf8 characters

Parameters
mixed$datadata to encode
Returns
string

Definition at line 339 of file oxstrmb.php.

oxStrMb::preg_match (   $sPattern,
  $sSubject,
$aMatches = null,
  $iFlags = null,
  $iOffset = null 
)

PHP preg_match() function wrapper

Parameters
string$sPatternpattern to search for, as a string
string$sSubjectinput string
array&$aMatchesis filled with the results of search
int$iFlagsflags
int$iOffsetplace from which to start the search
Returns
string

Definition at line 209 of file oxstrmb.php.

oxStrMb::preg_match_all (   $sPattern,
  $sSubject,
$aMatches = null,
  $iFlags = null,
  $iOffset = null 
)

PHP preg_match_all() function wrapper

Parameters
string$sPatternpattern to search for, as a string
string$sSubjectinput string
array&$aMatchesis filled with the results of search
int$iFlagsflags
int$iOffsetplace from which to start the search
Returns
string

Definition at line 225 of file oxstrmb.php.

oxStrMb::preg_replace (   $aPattern,
  $sString,
  $sSubject,
  $iLimit = -1,
  $iCount = null 
)

PHP preg_replace() function wrapper

Parameters
mixed$aPatternpattern to search for, as a string
mixed$sStringstring to replace
string$sSubjectstrings to search and replace
int$iLimitmaximum possible replacements
int$iCountnumber of replacements done
Returns
string

Definition at line 186 of file oxstrmb.php.

oxStrMb::preg_split (   $sPattern,
  $sString,
  $iLimit = -1,
  $iFlag = 0 
)

PHP preg_split() function wrapper

Parameters
string$sPatternpattern to search for, as a string
string$sStringinput string
int$iLimit(optional) only substrings up to limit are returned
int$iFlagflags
Returns
string

Definition at line 170 of file oxstrmb.php.

oxStrMb::recodeEntities (   $sInput,
  $blToHtmlEntities = false,
  $aUmls = array(),
  $aUmlEntities = array() 
)

Recodes and returns passed input: if $blToHtmlEntities == true � -> ä if $blToHtmlEntities == false ä -> �

Parameters
string$sInputtext to recode
bool$blToHtmlEntitiesrecode direction
array$aUmlslanguage specific characters
array$aUmlEntitieslanguage specific characters equivalents in entities form
Returns
string

Definition at line 299 of file oxstrmb.php.

oxStrMb::strip_tags (   $sString,
  $sAllowableTags = '' 
)

PHP strip_tags() function wrapper.

Parameters
string$sStringthe input string
string$sAllowableTagsan optional parameter to specify tags which should not be stripped
Returns
string

Definition at line 352 of file oxstrmb.php.

oxStrMb::strlen (   $sStr)

PHP multibute compliant strlen() function wrapper

Parameters
string$sStrstrint to mesure its length
Returns
int

Definition at line 44 of file oxstrmb.php.

oxStrMb::strpos (   $sHaystack,
  $sNeedle,
  $iOffset = null 
)

PHP multibyte compliant strpos() function wrapper

Parameters
string$sHaystackvalue to search in
string$sNeedlevalue to search for
int$iOffsetinitial search position
Returns
string

Definition at line 73 of file oxstrmb.php.

oxStrMb::strrcmp (   $sStr1,
  $sStr2 
)

Compares two strings. Case sensitive. For use in sorting with reverse order

Parameters
string$sStr1String to compare
string$sStr2String to compare
Returns
int > 0 if str1 is less than str2; < 0 if str1 is greater than str2, and 0 if they are equal.

Definition at line 370 of file oxstrmb.php.

oxStrMb::strstr (   $sHaystack,
  $sNeedle 
)

PHP multibute compliant strstr() function wrapper

Parameters
string$sHaystackvalue to search in
string$sNeedlevalue to search for
Returns
string

Definition at line 91 of file oxstrmb.php.

oxStrMb::strtolower (   $sString)

PHP multibute compliant strtolower() function wrapper

Parameters
string$sStringstring being lowercased
Returns
string

Definition at line 107 of file oxstrmb.php.

oxStrMb::strtoupper (   $sString)

PHP multibute compliant strtoupper() function wrapper

Parameters
string$sStringstring being lowercased
Returns
string

Definition at line 119 of file oxstrmb.php.

oxStrMb::substr (   $sStr,
  $iStart,
  $iLength = null 
)

PHP multibute compliant substr() function wrapper

Parameters
string$sStrvalue to truncate
int$iStartstart position
int$iLengthlength
Returns
string

Definition at line 58 of file oxstrmb.php.

oxStrMb::ucfirst (   $sSubject)

PHP ucfirst() function wrapper

Parameters
string$sSubjectinput string
Returns
string

Definition at line 237 of file oxstrmb.php.

oxStrMb::wordwrap (   $sString,
  $iLength = 75,
  $sBreak = "\n",
  $blCut = null 
)

PHP wordwrap() function wrapper

Parameters
string$sStringinput string
int$iLengthcolumn width
string$sBreakline is broken using the optional break parameter
bool$blCutstring is always wrapped at the specified width
Returns
string

Definition at line 253 of file oxstrmb.php.

Member Data Documentation

oxStrMb::$_aUmlEntities = array('&auml;', '&ouml;', '&uuml;', '&Auml;', '&Ouml;', '&Uuml;', '&szlig;' )
protected

Definition at line 26 of file oxstrmb.php.

oxStrMb::$_aUmls = array( "\xc3\xa4", "\xc3\xb6", "\xc3\xbc", "\xC3\x84", "\xC3\x96", "\xC3\x9C", "\xC3\x9F" )
protected

Definition at line 20 of file oxstrmb.php.

oxStrMb::$_sEncoding = 'UTF-8'
protected

Definition at line 13 of file oxstrmb.php.


The documentation for this class was generated from the following file: