mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-05 07:29:20 +00:00
Add function array_type
This commit is contained in:
@@ -3274,6 +3274,21 @@ if (!function_exists('get_memory_details')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('array_type')) {
|
||||
/**
|
||||
* Determines if the array is single or multi-dimensional array.
|
||||
*
|
||||
* @return string Options: single, multi
|
||||
*/
|
||||
function array_type(array $array): string {
|
||||
$result = count($array, COUNT_RECURSIVE) > count($array);
|
||||
if ($result) {
|
||||
return 'multi';
|
||||
}
|
||||
return 'single';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('mb_convert_encoding')) {
|
||||
function mb_convert_encoding($str, $to_encoding, $from_encoding = null) {
|
||||
// if no from_encoding specified, try to detect it
|
||||
|
||||
Reference in New Issue
Block a user