Extract multiple Strings between two String in PHP
I am trying to make this work but I can't: $str = "<html>1</html><html>2</html><html>3</html>"; $matches = array(); preg_match_all("(?<=<html>)(.*?)(?=</html>)", $str, $matches); foreach ($matches as $d) { echo $d; } What I am doing wrong? The output must be: 123