Hello guyz, I'm glad I finally back here.

I need help using the preg_match function.
I am scraping url and I need to get the specific value from the html tags.
Here is the string <p><b>1,664</b> Referring IP addresses</p>, I need to get 1,664 How can I achieve it using php?

Recommended Answers

All 2 Replies

preg_match('@<p><b>(.*?)</b>@i', '<p><b>1,664</b> Referring IP addresses</p>', $matches);

Thank you pritaeas, it works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.