6
PHP配列に問題があります。まず、配列の内部に配列があり、重複を取り除こうとしています。私は、配列のますprint_rを行なったし、それがこれをプリントアウト....PHPは配列から重複を削除します
Array (
[0] => Array ([creditfeeid] => 318 [client] => Test 1 [adjustment] => 444.00 [issuedate] => 2012-02-10 20:27:00 [isrecurring] => No [comment] => 444 [commission] => 17.76)
[1] => Array ([creditfeeid] => 319 [client] => Test 1 [adjustment] => 333.00 [issuedate] => 2012-02-10 20:27:00 [isrecurring] => No [comment] => 333 [commission] => 9.99)
[2] => Array ([creditfeeid] => 320 [client] => Test 1 [adjustment] => 111.00 [issuedate] => 2012-02-10 20:27:00 [isrecurring] => No [comment] => 111 [commission] => 1.11)
[3] => Array ([creditfeeid] => 321 [client] => Test 1 [adjustment] => 222.00 [issuedate] => 2012-02-10 00:00:00 [isrecurring] => No [comment] => 111 [commission] => 2.22)
[4] => Array ([creditfeeid] => 292 [client] => Test 1 [adjustment] => 555.00 [issuedate] => 2012-01-25 13:04:43 [isrecurring] => Yes [comment] => 555 [commission] => 5.00)
[5] => Array ([creditfeeid] => 317 [client] => Test 2 [adjustment] => 666.00 [issuedate] => 2012-02-10 00:00:00 [isrecurring] => No [comment] => 666 [commission] => 39.96)
)
私は
111ある[「コメント」]で重複を削除しようとしています私はunique_arrayで作業していますが、そのトリックはしていないようです。これは、私が試したもの....
foreach($array as $row){
if(array_unique($row['comment'])){
continue;
}else{
echo $row['comment'] . "<br/>";
}
}
も
$array = array_unique($array);
foreach($array as $row){
echo $row['comment'] . "<br/>";
}
をである私が間違って何をしているのですか? array_uniqueは私の問題の答えではありませんか?事前に
おかげで、
J
どちらを重複して保存しますか? – bozdoz