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

  • Home
  • SEARCH
  • 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 8476713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:15:22+00:00 2026-06-10T18:15:22+00:00

I need to read and parse HTML file inside php code (on server side).

  • 0

I need to read and parse HTML file inside php code (on server side).
As much as I know, the easiest way to read html for choose nodes and nodes’ childrens, is to use jQueries.
Can I include in php code jQueries for open an HTML file, read it, and return to the php code array object?
Thanks 🙂

  • 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-10T18:15:24+00:00Added an answer on June 10, 2026 at 6:15 pm

    You cannot use javascript (jQuery) server side, because it is client side, Browser based.

    The easiest way to read and parse HTML is DOMDocument, eg:

    $html = new DOMDocument(); 
    $html->loadHTMLFile('http://www.example.org'); 
    $links = array(); 
    foreach($html->getElementsByTagName('a') as $link) { 
        $links[] = array('url' => $link->getAttribute('href'), 'text' => $link->nodeValue); 
    } 
    var_export($links);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read the size of a file but the server is forcing
I need to read a html page and parse the contents of a table
I am using HtmlAgilityPack to read a parse a html file and extract some
I'm using ruby to read a file and I need to somehow parse some
I need to parse/read a lot of HTML webpages (100+) for specific content (a
I need to read a HTML file and search for some tags in it.
I need to parse a multiple(read approx 1600) HTML pages and pull out the
I Need to parse a html file in python, and stock the content in
I am doing a project wherein I need to read an HTML file and
I'm using ROME library to parse Blogger Atom feed and I need to read

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.