Hi there,
A few days ago, I posted a question about detecting substrings, well that is sorted to a point...
I have this code...
<?
function inString($start, $end, $string)
{
eregi(".".$start."(.)".$end.".*",$string,$result);
return($result[1]);
}
$headline=inString("<headline>","</headline>",$idea);
$datetime=inString("<datetime>","</datetime>",$idea);
$summary=inString("<summary>","</summary>",$idea);
echo($headline);
echo($datetime);
echo($summary);
?>
this detects the tag <headline> and the close tag, and shows the text within the tags.
No probs, but when I have several tags (several stories) only the last story is shown.
Can anyone help me to ensure that the search for <headline> tags displays all the instances of <headline>
A reminder, all stories are enclosed within a <story> tag too.
How can I get round this?
Any ideas?
Tris...