I need to take the output of $one
and make an array, however, the regex is not right because all I get back is an array with one key and one value; basically, the entire string. If there are 10 paragraph tags in the string then I should get 10 values in the array.
What is wrong with my regex?
Ideally, what I would like to have in the output array are two arrays, one with the paragraph tags and another with just the text between them.
$one = preg_replace( '/<p>/i', '<p class="test">', $str ); // This gives me what I need
print_r(explode( '/<p class="test">/iU', $one )); // This does not