How can I change this code below to only match everything between <starttag> and the first occurrence of </endtag> i.e in case there happened to be more than one </endtag> ? eregi('<starttag>(.*)</endtag>',$fcg,$got); Code (markup): Thanks in advance!
preg_match('~<starttag>(.*?)</endtag>~',$fcg,$got); PHP: Try to avoid ereg_* functions, as they're about 6 times slower than preg_* functions.