How to get a substring throughout document knowing the markers?
I know the strings开发者_StackOverflow社区 in need lie between
"=t\">" and ")"
but this occurs several times in a body of text.
How can I extract between multiple instances of this occurence?
I have tried Explode, a variety of functions, preg_split, for 6 hours and only getting wrong results - Is it even possible?
Assuming your delimiters are =t\">
and )
.
preg_match_all('/=t\\">([.\n]+?)\)/', $str, $matches);
var_dump($matches);
It sounds like you are trying to parse some HTML. Have you considered DOMDocument?
精彩评论