private static function encode_array($array)
{
if (self::is_list($array)) {
$return = 'l';
foreach ($array as $value) {
$return .= self::encode($value);
}
} else {
ksort($array, SORT_STRING);
$return = 'd';
foreach ($array as $key => $value) {
$return .= self::encode(strval($key)) . self::encode($value);
}
}
return $return . 'e';
}