$thing - The input array. * * @return array - The sorted array. */ public static function ksort(array $thing = []): array { ksort($thing, SORT_STRING); return $thing; } /** * Like `queryString` does but without the `sign` and `empty value` entities. * * @param array $thing - The input array. * * @return string - The `key=value` pair string whose joined by `&` char. */ public static function queryStringLike(array $thing = []): string { $data = []; foreach ($thing as $key => $value) { if ($key === 'sign' || is_null($value) || $value === '') { continue; } $data[] = implode('=', [$key, $value]); } return implode('&', $data); } }