20 protected $_aUmls = array(
"\344",
"\366",
"\374",
"\304",
"\326",
"\334",
"\337" );
26 protected $_aUmlEntities = array(
'ä',
'ö',
'ü',
'Ä',
'Ö',
'Ü',
'ß' );
58 public function substr($sStr, $iStart, $iLength = null)
60 if (is_null($iLength)) {
61 return substr($sStr, $iStart);
63 return substr($sStr, $iStart, $iLength);
76 public function strpos($sHaystack, $sNeedle, $iOffset = null)
79 if ( $sHaystack && $sNeedle ) {
80 if ( is_null( $iOffset ) ) {
81 $iPos =
strpos( $sHaystack, $sNeedle );
83 $iPos =
strpos( $sHaystack, $sNeedle, $iOffset );
97 public function strstr($sHaystack, $sNeedle)
99 return strstr($sHaystack, $sNeedle);
147 return htmlentities( $sString, ENT_QUOTES, $this->_sEncoding );
172 public function preg_split($sPattern, $sString, $iLimit = -1, $iFlag = 0)
174 return preg_split( $sPattern, $sString, $iLimit, $iFlag );
188 public function preg_replace($sPattern, $sString, $sSubject, $iLimit = -1, $iCount = null)
190 return preg_replace( $sPattern, $sString, $sSubject, $iLimit, $iCount);
204 public function preg_match($sPattern, $sSubject, &$aMatches = null, $iFlags = null, $iOffset = null)
206 return preg_match( $sPattern, $sSubject, $aMatches, $iFlags, $iOffset);
220 public function preg_match_all($sPattern, $sSubject, &$aMatches = null, $iFlags = null, $iOffset = null)
222 return preg_match_all( $sPattern, $sSubject, $aMatches, $iFlags, $iOffset);
235 return $sString . $this->
substr($sSubject, 1);
248 public function wordwrap($sString, $iLength = 75, $sBreak =
"\n", $blCut = null )
250 return wordwrap($sString, $iLength, $sBreak, $blCut);
265 public function recodeEntities( $sInput, $blToHtmlEntities =
false, $aUmls = array(), $aUmlEntities = array() )
267 $aUmls = ( count( $aUmls ) > 0 ) ? array_merge( $this->_aUmls, $aUmls) :
$this->_aUmls;
268 $aUmlEntities = ( count( $aUmlEntities ) > 0 ) ? array_merge( $this->_aUmlEntities, $aUmlEntities) :
$this->_aUmlEntities;
269 return $blToHtmlEntities ? str_replace( $aUmls, $aUmlEntities, $sInput ) : str_replace( $aUmlEntities, $aUmls, $sInput );
281 return $this->
preg_match(
"/(".implode(
"|", $this->_aUmls ).
"|(&))/", $sStr );
295 return $this->
preg_replace(
"/\n|\r|\t|\x95|\xa0|;/", $sCleanChr, $sStr );
307 if (is_array($data)) {
312 while ($blNumerical && (list($key) = each($data))) {
313 $blNumerical = !is_string($key);
316 return '['. implode(
',', array_map(array($this,
'jsonEncode'), $data)).
']';
318 foreach ($data as $key => $val) {
324 $ret .=
'"'.addslashes($key).
'":'. $this->
jsonEncode($val);
329 return '"'.addcslashes((
string)$data,
"\r\n\t\"\\").
'"';
343 if ( stripos( $sAllowableTags,
'<style>' ) ===
false ) {
345 $sString = $this->
preg_replace(
"'<style[^>]*>.*</style>'siU",
'', $sString );
347 return strip_tags( $sString, $sAllowableTags );
361 return -strcmp( $sStr1, $sStr2 );