Getting total sub strings in the string
<p>I am trying to get sub string in between two sub strings in string. By using this code</p>

<p>I am getting first sub string only. Can you please say how can I get all sub strings?</p>

<p>Thanks
Sateesh
Using code:</p>

<pre><code>&lt;?php 
 function get_string_between($string, $start, $end){
    $string = " ".$string;
    $ini = strpos($string,$start);
    $ini += strlen($start);
    $len = strpos($string,$end,$ini) - $ini;

    return substr($string,$ini,$len);

}
$fullstring = "[tag]php[/tag] [tag]java[/tag] "; 
$count = substr_count($fullstring, '[tag]');
for($i=0; $i&lt;$count;$i++){
$parsed = get_string_between($fullstring, "[tag]", "[/tag]");
echo "LineItems[$i]:".$parsed."&lt;br&gt;"; 
}
?&gt;
</code></pre>
