我創建需要持有一些像這樣的空值的數組:如何將一個空值插入到PHP數組中?
$my_array['message'] = 'hello there';
$my_array['sender'] = 'Billy Bob';
$my_array['comment'] = '';
var_dump($my_array);
VAR轉儲的結果是:
array
'message' => 'hello there';
'sender' => 'Billy Bob';
我想要的結果看起來是這樣的:
array
'message' => 'hello there';
'sender' => 'Billy Bob';
'comment' => '';
這可能嗎?
你試過了嗎? – Marcus
事實上,[確切發生了什麼](http://ideone.com/429nh)。 – Jon
@Marcus正如你所看到的,他發佈了'var_dump'結果。 – hsz