There is a site page. The page has the following element:

<span class="phonebox"> телефон:<h4>+7 (999) 999-99-99</h4> </span> 

Need to get a phone. I execute the following code:

 preg_match_all('#<h4>(([+]?[0-9\s-\(\)]{3,25})*$)#x', $content, $matches, PREG_PATTERN_ORDER); print_r($matches); 

In response, I get an empty array. Why?

    1 answer 1

    It would be more correct to #<h4>(([+]?[0-9\s-\(\)]{3,25})*)#x
    from the end, delete $ you have the string does not end there