Ich habe ein JSON Objekt und möchte daraus ein Array aus allen "href" erstellen. Klappt nicht.
Hier das JSON Objekt:
Ich wollte so vorgehen:
Hat jemand eine Idee?
Hier das JSON Objekt:
Code:
object(stdClass)#6 (2) { ["a"]=> array(3) { [0]=> object(stdClass)#7 (2) { ["href"]=> string(4) "?p=1" ["strong"]=> string(1) "1" } [1]=> object(stdClass)#8 (2) { ["href"]=> string(4) "?p=2" ["content"]=> string(1) "2" } [2]=> object(stdClass)#9 (2) { ["href"]=> string(4) "?p=3" ["content"]=> string(1) "3" } } ["content"]=> string(52) "Seite: | | " }
PHP-Code:
$c = array();
$i=0;
foreach($data as $row) {
$c[$i] = $row->a[$i]->href;
$i++;
}
Kommentar