1

I've been around these yer' internets many a time and I seem to be able to find an answer. I have also tried every combination I can think of.

I have an array

["results"]=> array(20) {
[0]=> object(stdClass)#5 (6) 
["area"]=> string(9) "Flint, MI"
["tag/_text"]=> string(11) "sevenseas"
....

I'm trying to access the "tag/_text" within a loop can't seem to

foreach ($holder as $dets) {
    $tag  = $dets->tag/_text; 
    $area  = $dets->area;
 }

How do I get the $tag value?

1 Answers1

2

You might want to read http://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex It explains that you can use curly brackets to create complex expressions.

You can access the property of the object with the following expression $dets->{'tag/_text'}

mcq8
  • 249
  • 1
  • 5