I am scraping a document and have 2 different arrays: the titles and the links. I am using array_push() to store each item in their own array. I scrape 2 different documents for the same arrays. I would like afterwards the 2 arrays to be compared and for any matching titles to have 2 different links associated with the same title. This way I can display
title1: source 1, source 2
title2: source 1, source 2.
is this possible?
This will combine your arrays into a title => link format, where link may be an array if multiple sources were found. This is a very simplistic approach, you could get more advanced by comparing case-insensitively and making sure that
$linkis only adding unique entries to the combined array.