I am trying to get the URL variable ID from a list of objects in an array and display them.
Current Code:
$display = print_r($array);
echo $display;
Output:
Array ( [0] => https://example.com?ID=435 [1] => https://example.com?ID=53 [2] => https://example.com?ID=5 [3] => https://example.com?ID=25 )
I would like the display each URL variable ID from the array inside a <div> element:
<div>435</div>
<div>53</div>
<div>5</div>
<div>25</div>
I have tried to do this using the following code but no luck:
foreach($display as $display2) {
echo '<div>'.$_GET['ID'].'</div>';
}
$_GETvariable pulls from the current page's request and is not a function for stripping query data from a string.