The json data object below is what’s returned from a custom Google search API request. I need to extract each of the “url” elements and place them into an array (using PHP).
myArray = {url1, url2, url3, etc…}
How?
data = '{
"responseData":
{
"results":
[
{
//etc
}
]
}
Am I right that you have JSON string? Use json_decode to decode it. After that you can use
(Requires PHP 5.3 for anonymous function, you can use no anonymous ones if use PHP5.2 or older)
For later versions: