<?php $str = 'foo<span>hello</span>bar<span>world</span>';preg_match_all('~<span>(.*?)<\/span>~', $str, $matches);var_export($matches);
Standard input is empty
array ( 0 => array ( 0 => '<span>hello</span>', 1 => '<span>world</span>', ), 1 => array ( 0 => 'hello', 1 => 'world', ), )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!