$ch = curl_init("url");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "test");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$outputArray = curl_exec($ch);
Dann wird $outputArray enthalten:
Array
(
[0] => Array
(
[r1] => test response
[r2] => 4
[r3] => 32
)
)
So würde ich denken, PHP kann sehen, dass es ein Array ist und behandeln es als solche, aber wenn ich etwas wie tun
echo $outputCode[0][r_title]."\n";
gibt es eine Fehlermeldung:
PHP Fatal error: Cannot use string offset as an array in /www/test.php on line 75
(Zeile 75 ist das Echo, das gerade oben steht)
Was mache ich falsch?