示例#1
0
 /**
  * Merge key with value
  *
  * @param array $array current array
  * @param string $separator separator
  * @param int $const constant
  *
  * - `ESCAPE` escape value quotes
  *
  * @return array
  */
 public static function concatKeyValue(array $array, $separator = '=', $const = 0)
 {
     $result = [];
     foreach ($array as $key => $value) {
         $result[] = $key . (isset($value) && $value !== 'null' ? $separator . ($const & static::ESCAPE ? StringHelper::doubleQuotes($value) : $value) : null);
     }
     return $result;
 }