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
Post a Comment