Avatar

functions.inc.php (Bugs)

by Micha ⌂, Monday, November 01, 2010, 10:29 (4919 days ago) @ Auge

Hello,

except you give an empty encoding declaration to my_substr.

$substring = my_substr($string, '');

Isn't it possible to check the $encoding variable inside the function like?

function my_strlen($string, $encoding='utf-8') {
   if(function_exists('mb_strlen')) 
     return mb_strlen($string, empty($encoding)?"utf-8":$encoding);
   else
     return strlen($string);
}


regards Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences


Complete thread:

 RSS Feed of thread