Skip to content
Advertisement

Adding multiple columns to array

I would like to add several values that I webscrape to a final result array. Each value that I scrape represents a column in the array.

See below what I tried:

JavaScript

My problem is that the individual results do not get pushed to the array. Any suggestions why?

Is there a better method to add multiple attributes to an array?

I appreciate your replies!

Advertisement

Answer

$result is not known in your closure.

try USE to include the external variable $result within the filter-closure, like so :

JavaScript

http://php.net/manual/en/class.closure.php

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement