Take a particular string from a file using php
<p>Dear All,
i have a txt file like:</p>

<pre><code>--start--
  jeff
--end--
--start--
  sophya
--end--
</code></pre>

<p>Now i need to collect the names like jeff and sophya into an array.How i do it?I use below code but its not give me proper output.</p>

<pre><code>$data = file_get_contents('http://localhost/sample.txt');
$start_position = strstr($data,'--start--');
$end_position    = strpos($data,'--end--') ;
$value=substr($start_position,$end_position);
print_r($value);
exit();
</code></pre>

<p>My out put is : <code>--end-- --start-- sophya --end--</code></p>

<p>is their any kind heart who help me to take two name into an array?
thanks in advance.riad</p>
