我得到我的輸出是這樣的:刪除索引鍵從一個數組
Array(
0 => Array(10593 => Array("title" => 'Contact', "desc" => '')),
1 => Array(11468 => Array("title" => 'Sign Up', "desc" => 'Newsletter sign up')),
2 => Array(19187 => Array("title" => 'Health', "desc" => 'This is your form description. Click here to edit.')),
3 => Array(25707 => Array("title" => 'Sample Form', "desc" => 'This is Sample Form.')),
4 => Array(27027 => Array("title" => ' ksdfmlskdfmlskdfmlsdfm', "desc" => 'This is your form description. Click here to edit')),
5 => Array(27908 => Array("title" => 'dkjnkxcjnxckjnv ', "desc" => 'This is your form description. Click here to edit.')),
6 => Array(28164 => Array("title" => 'test ', "desc" => 'This is your form description. Click here to edit.'))
);
我想從目前的陣列輸出刪除所有索引鍵,我應該如何操作呢?請建議。
輸出應該是:
Array(
10593 => Array("title" => 'Contact', "desc" => ''),
11468 => Array("title" => 'Sign Up', "desc" => 'Newsletter sign up'),
19187 => Array("title" => 'Health', "desc" => 'This is your form description. Click here to edit.'),
25707 => Array("title" => 'Sample Form', "desc" => 'This is Sample Form.'),
27027 => Array("title" => ' ksdfmlskdfmlskdfmlsdfm', "desc" => 'This is your form description. Click here to edit'),
27908 => Array("title" => 'dkjnkxcjnxckjnv ', "desc" => 'This is your form description. Click here to edit.'),
28164 => Array("title" => 'test ', "desc" => 'This is your form description. Click here to edit.'),
);
而你在做什麼得出結果? – Pietu1998
似乎所有你需要做的是寫一個簡單的循環。什麼阻止你? – Barmar
也許你應該修復創建原始數組的代碼。這似乎是一個非常愚蠢的組織方式。 – Barmar