1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
$i=0; $array_id_old_feed = []; $array_id_new_feed = []; $xml = simplexml_load_file('VBHy6J9p0cSJyNpgzftWAyeemploypsg.xml'); $p_cnt = count($xml->channel->item); echo 'Count for item old feed: '.$p_cnt.'<br/>'; foreach ($xml->channel->item as $value){ $i++; //echo $i.' '.$value->id . '<br/>'; array_push($array_id_old_feed ,strval($value->id)); } $xml = simplexml_load_file('E-Commerce_Product_List.xml'); $p_cnt = count($xml->channel->item); echo 'Count for item new feed: '.$p_cnt.'<br/>'; $i=0; foreach ($xml->channel->item as $value){ $i++; // echo $i.' '.$value->id . '<br/>'; array_push($array_id_new_feed ,strval($value->id)); } $i=0; echo '<br/>Search differnce id between old and new<br/>'; foreach($array_id_old_feed as $array_id_old_feed_item){ //var_dump(in_array($array_id_old_feed_item, $array_id_new_feed)); if(!in_array($array_id_old_feed_item, $array_id_new_feed)){ $i++; echo '<br/>'.$i.' '.$array_id_old_feed_item; } } echo '<br/>'.$i.' differences finded between old and new<br/>'; echo '<br/>Search differnce id between new and old<br/>'; $i=0; foreach($array_id_new_feed as $array_id_new_feed_item){ //var_dump(!in_array($array_id_new_feed_item, $array_id_old_feed)); if(!in_array($array_id_new_feed_item, $array_id_old_feed)){ $i++; echo '<br/>'.$i.' '.$array_id_new_feed_item; } } echo '<br/>'.$i.' differences finded between new and old<br/>'; |