tuppertoller Posted June 23, 2008 Share Posted June 23, 2008 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] Link to comment https://forums.phpfreaks.com/topic/111541-extracting-part-of-an-array-into-a-variable/ Share on other sites More sharing options...
The Little Guy Posted June 23, 2008 Share Posted June 23, 2008 Give this a try: $var = $record['data']['42.12']['Interests::Description']; print_r($var); Link to comment https://forums.phpfreaks.com/topic/111541-extracting-part-of-an-array-into-a-variable/#findComment-572508 Share on other sites More sharing options...
tuppertoller Posted June 23, 2008 Author Share Posted June 23, 2008 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? Link to comment https://forums.phpfreaks.com/topic/111541-extracting-part-of-an-array-into-a-variable/#findComment-572526 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.