Return in array
<p>I have these php lines:</p>

<pre><code>&lt;?php
$start_text = '&lt;username="';
$end_text = '" userid=';
$source = file_get_contents('http://mysites/users.xml');
$start_pos = strpos($source, $start_text) + strlen($start_text);
$end_pos = strpos($source, $end_text) - $start_pos;
$found_text = substr($source, $start_pos, $end_pos);
echo $found_text;
?&gt;
</code></pre>

<p>I want to see just the names from entire file, but it shows me just the first name. I want to see all names.</p>

<p>I think it is something like: <code>foreach ($found_text as $username)</code>.... but here I am stuck.</p>

<hr>

<hr>

<p><strong>Update from OP post, below:</strong></p>

<pre><code>&lt;?php
$xml = simplexml_load_file("users.xml");

  foreach ($xml-&gt;children() as $child)
  {
        foreach($child-&gt;attributes() as $a =&gt; $b)
        {
          echo $a,'="',$b,"\"&lt;/br&gt;";

        }


               foreach ($child-&gt;children() as $child2)
    {

                foreach($child2-&gt;attributes() as $c =&gt; $d)
        {
          echo "&lt;font color='red'&gt;".$c,'="',$d,"\"&lt;/font&gt;&lt;/br&gt;";
        }

    }
  }
?&gt;
</code></pre>

<p>with this code, i receive all details about my users, but from all these details i want to see just 2 or 3</p>

<p>Now i see :</p>

<pre><code>name="xxx"
type="default"
can_accept="true"
can_cancel="false"
image="avatars/trophy.png"
title="starter"
........etc
</code></pre>

<p>Another details from the same user "Red color(defined on script)"</p>

<pre><code>reward_value="200"
reward_qty="1"
expiration_date="12/07/2012"
.....etc
</code></pre>

<p>what i want to see?</p>

<p>i.e  first line from first column "<code>name="xxx</code>" &amp; <code>expiration_date="12/07/2012</code>" from second column</p>
