Jump to content

Extracting part of an array into a variable


tuppertoller

Recommended Posts

The attached file shows the start of the data in an array. It's all in a variable called $record. How do I move the part of the data called Interests::Description into it's own variable so that I can display it line by line.

 

Thanks in advance.

 

[attachment deleted by admin]

No that displays nothing. I saw how you were heading though and so I added this [0] to the end of your suggestion:

 

$var = $record['data']['42.12']['Interests::Description'][0];

print_r($var);

 

Thinking that it needed a specific key so that it would show "Classical Music". Even that would be a start but it displays nothing?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.