pedroz
1
need to find the position of the first html tag without </ after the word togowentgone
$a = ‘<p>hi</p><p>togowentgone</p> <br />’
here it would be <br />
// position=30
$b = ‘<br /><strong><p>togowentgone</p></strong> <hr />’
here it would be <hr />
// position=44
could you please give me a clue?
MattCA
2
$search = 'togowentgone';
$text = '<br /><strong><p>togowentgone</p></strong> <hr />';
$txtPos = strpos($text, $search) + strlen($search);
preg_match('/<([a-zA-Z]+)/', substr($text, $txtPos), $match);
$position = strpos($text, $match[0], $txtPos)+1;
$position = 44;