regex - find the mobile number and print using regular expression using php -


<div> <span onclick="find('test','call now!');phone.open('ayyappa','970-363-9869',32659874,0)" > call now! </span> <span onclick="find('test','call now!');phone.open('ayyappa','949-858-3181',38596380,0)" > call now! </span> </div> 

expected out put : 949-858-3181 , 38596380

for specific use, regex (\d{3}-\d{3}-\d{4})\',(\d{8})

preg_match('/(\d{3}-\d{3}-\d{4})\',(\d{8})/', $input_html, $matches); $n1 = $matches[1]; $n2 = $matches[2]; 

n1 have phone number , n2 second number.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -