";
return $html;
}
/**
* Sort a multidimensional array on a array kay (found on http://php.net/manual/en/function.sort.php)
* @array array the array
* @key str the field to use as key to sort
* @order str sort method: "ASC", "DESC"
*/
function alo_em_msort ($array, $key, $order = "ASC") {
$tmp = array();
foreach($array as $akey => $array2) {
$tmp[$akey] = $array2[$key];
}
if ($order == "DESC") {
arsort($tmp , SORT_NUMERIC );
} else {
asort($tmp , SORT_NUMERIC );
}
$tmp2 = array();
foreach($tmp as $key => $value) {
$tmp2[$key] = $array[$key];
}
return $tmp2;
}
/**
* Remove HTML tags, including invisible text such as style and
* script code, and embedded objects. Add line breaks around
* block-level tags to prevent word joining after tag removal.
* (based on http://nadeausoftware.com/articles/2007/09/php_tip_how_strip_html_tags_web_page )
*/
function alo_em_html2plain ( $text ) {
// transform in utf-8 if not yet
//$text = utf8_encode($text);
if ( function_exists( 'mb_detect_encoding' ) && mb_detect_encoding($text, "UTF-8") != "UTF-8" ) $text = utf8_encode($text);
$text = preg_replace(
array(
// Remove invisible content
'@