Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get the values of the all objects of a large array and set them to the variables?
    primarykey
    data
    text
    <p>I'm newbie in PHP. I have to code the system like RSS Reader in this language. So I parsed XML files (which are RSS Feeds) and got a large array which has many sub-arrays. Since it is hard to explain what I need, I decided to add the example code. <br/> As you see, there is an <em><code>items</code></em> in my large array and there are a lot of sub-array of <em><code>items</code></em> array, for example, <em><code>[0]</code></em>, <em><code>[1]</code></em>, <em><code>[2]</code></em>, <em><code>[3]</code></em> and so on. (I added to the examples just 2 ones of them - <em><code>[0]</code></em> and <em><code>[1]</code></em>)</p> <pre><code>Array ( [items] =&gt; Array ( [0] =&gt; Array ( [title] =&gt; First title [alternate] =&gt; Array ( [0] =&gt; Array ( [href] =&gt; http://example-one.com/first-title/ ) ) [contents] =&gt; Array ( [content] =&gt; First content ) [author] =&gt; First author [origin] =&gt; Array ( [htmlUrl] =&gt; http://example-one.com ) ) [1] =&gt; Array ( [title] =&gt; Second title [alternate] =&gt; Array ( [0] =&gt; Array ( [href] =&gt; http://example-two.com/second-title/ ) ) [contents] =&gt; Array ( [content] =&gt; Second content ) [author] =&gt; Second author [origin] =&gt; Array ( [htmlUrl] =&gt; http://example-two.com ) ) ) ) </code></pre> <p>So I need to get the values of the all objects in the output and set them to the variables in the loop. For example, the output of this array must be like this: <br/></p> <pre><code>title = First title href = http://example-one.com/first-title/ content = First content author = First author htmlUrl = example-one.com title = Second title href = http://example-two.com/second-title/ content = Second content author = Second author htmlUrl = example-two.com </code></pre> <p>Since, I'm beginner in PHP, it's hard to write the code of logic. If you have any idea for solving this problem, please answer. Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload