📜  php force array keys trim - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:53.783000             🧑  作者: Mango

代码示例1
$my_array = array( 'one 1' => '1', 'two 2' => '2' );
$keys = str_replace( ' ', '', array_keys( $my_array ) );
$results = array_combine( $keys, array_values( $my_array ) );