Hello everyone here is my case:
I\'m crawling through the old page with more than 10 000 comments which I\'m trying to import to WordPress.
I\'m using simpl
You are getting the array two times because you are adding whole array value $commItem
to $commArr
during both odd and even numbers using if condition. That's why you are getting array double time.
Replace your code
foreach($rawComm as $commItem) {
if($z % 2 == 0) {
$commArr['text'] = $commItem;
}else{
$commArr['sign'] = $commItem;
//echo $commItem;
}
echo 'Numer wpisu: '.$z.'
';
$z++;
}
to this one
foreach($rawComm as $commItem) {
$commArr[] = array('text'=>$commItem[0], 'sign'=>$commItem[1]);
}
I think this might work for you :).