How would I iterate through an array (300+ items, imported via simplexml) and pull out every item that has a certain $x->channel->item->title and put that into a different array?
I can’t make heads or tails of the haystack needle thing or how to push arrays
Say I have an array (needle) like: array(“3332″,”3300″,”3493″,”8380”) and I want to match if any of those appear through the big array (haystack). How do I do this?
You have to iterate over your big array, and check for the value of
$x->channel->item->title. If it meets your criteria, push it into the new array: