Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8428329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:01:23+00:00 2026-06-10T05:01:23+00:00

A webiste www.example.com have many lists in it. That is, <ol> <li>This is a

  • 0

A webiste http://www.example.com have many lists in it. That is,

   <ol>
    <li>This is a list saying about asp</li>
    <li>This is a list  saying about javascript</li>
    <li>This is a list saying about php</li>
    <li>This is a list saying about .net</li>
    </ol>

I need to Get the list with a word “php” using php.

That is the output should be “This is a list saying about php“

How can i do this with preg_match???

I used CURL class to fetch the HTML contents.
here is the code i used

$site = $curl->get("http://www.example.com/outputs.html");
$pattern = 'I NEED TO GET THIS PATTERN';
preg_match($pattern, $site, $matches);
$php_out = $matches[1];
echo $php_out;

when i use,

$pattern = '/<li>(.*?)<\/li>/s';

It returns the first result
That is “This is a list saying about asp“

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:01:25+00:00Added an answer on June 10, 2026 at 5:01 am

    You need a website crawler and a parser. There is a project called PHPCrawl with this lib you can crawl the site and get the content. Then you can parse and search in the source code for the specified pattern. If you want you can do it with a regex.

    But i think you are not the first here on Stackoverflow with this problem. Perhaps you should search here and you’ll get some more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage (say www.example.com/a.asp) .. I am having an iframe in this
I have a page like for example: http://www.stackoverflow.com/how-many-users-visited I have inside that page already
Say I have an ASP.Net MVC webiste hosted at www.somedomain.com. Now I am interested
Background: Suppose I have a website that is hosted on http://www.example.com and the site
I have a website on www.example.com and use Google Analytics. This website has lots
I have my website running at: www.example.com I also have this other domain: www.example.net
I have a website sitting on an IIS 7 server: WWW.example.COM I would like
basically i have a website i.e www.example.com when i enter www.example.com it deosnt work
I have a website let's say www.example.com and I have a subdomain something.example.com Both
Let's say I have a website with domain: www.example.com If I set a cookie

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.