Jump to content

Pull from array inside array


Boxerman

Recommended Posts

Hey guys,

 

Sorry to annoy you all with something so simple, but its truly causing hair to fall out (I'm running out as well!)

 

The script below is the core of what im running, however, in the example below you can see array inside array, i've tried everything such as: $feed_to_array['entry'][0]['title]; 

 

This is literally confusing me intensely, all i want to do is grab title and content, that is all! Why am i so stupid!

 

Thanks in advance all! 

<?php
error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors', '1');  
$feed = 'http://**deleting**?format=xml';
$feed_to_array = (array) simplexml_load_file($feed);
//$feed_to_array = (array) new SimpleXmlElement( file_get_contents($feed) );

echo '<pre>'; print_r($feed_to_array); echo '</pre>';
?>

Output:

Array
(
    [id] => tag:,2017:blog
    [title] => **removingURL**
    [link] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [href] => https://www.**removingURL**.com/?mode=atom
                        )

                )

            [1] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [rel] => license
                            [type] => text/html
                            [href] => http://creativecommons.org/licenses/by/2.0/
                        )

                )

        )

    [icon] => http://bulk2.**removingURL**.com/ele2/images/**removingURL**/favicon.ico
    [updated] => 2017-03-09T20:30:00Z
    [logo] => http://creativecommons.org/images/public/somerights20.gif
    [entry] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [id] => tag:https://www.**removingURL**.com/,2017:/post.phtml?pk=423974
                    [author] => SimpleXMLElement Object
                        (
                            [name] => CJ Andriessen
                            [uri] => http://www.****.com/blogs/CJ+Andriessen
                        )

                    [title] => Nep nep nep nep nep nep nep this winter
                    [link] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [href] => http://feedproxy.google.com/~r/**removingURL**/~3/sPJh-Cxxbeg/nep-nep-nep-nep-nep-nep-nep-this-winter-423974.phtml
                                )

                        )

                    [published] => 2017-03-09T20:30:00Z
                    [updated] => 2017-03-09T20:30:00Z
                    [content] => 
It has been several months since the last game in the Neptunia franchise hit western shores and something about that is just wrong. Usually, we’re drowning in releases, but it’s been barren since October’s crossover with the Sega Hard Girls franchise. Luckily, hope is on the horizon. 


Idea Factory International announced today Cyberdimension Neptunia: 4 Goddesses Online will release in North American and in the EU this winter. Coming to PS4 and Steam, Cyberdimension Neptunia features Neptune, Vert, Blanc, Noire and more teaming up to defeat the Demon King in the game-within-a-game known as 4 Goddesses Online. The title will feature 4 player co-op and online play.


After watching the trailer below, I call dibs on my bae Nepgear.

					

						Nep nep nep nep nep nep nep this winter screenshot
					


				Read more...
                )

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.