P粉8264299072023-08-07 09:41:59
$values =[]; foreach ($user as $key => $value) { $values[] = "{$key} is {$value}"; } echo implode(', ', $values);
或者
$values = array_map(fn($key, $value) => "{$key} is {$value}", array_keys($user), $user); echo implode(', ', $values);