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 8770339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:32:31+00:00 2026-06-13T17:32:31+00:00

How do I cut out only the first <tr class=ismResult> and <tr class=ismFixtureSummary> in

  • 0

How do I cut out only the first <tr class="ismResult"> and <tr class="ismFixtureSummary"> in this, but not the second set?

I am looking to cut out only the first two <tr> tags and contents. Is there a way to set both of these to a variable eg, $Result? I’m looking to keep the html as part of it.

<table>
    <tbody>
        <tr class="ismResult">
            <td>2-0</td>
        </tr>

        <tr class="ismFixtureSummary">
            <td>Player1</td>
            <td>Player2</td>
        </tr>

         <tr class="ismResult">
            <td>1-1</td>
        </tr>

        <tr class="ismFixtureSummary">
            <td>Player3</td>
            <td>Player4</td>
        </tr>
    </tbody>
</table>

WHAT I’VE TRIED:

include('simple_html_dom.php');
$url = 'http://www.test.com';
$html = file_get_html($url);

$FullTable = $html->find('table');

foreach($FullTable->find('tr[class=ismResult]') as $Heading)
    {
    echo $Heading;

    foreach($FullTable->find('tr[class=ismFixtureSummary]') as $Summary)    
    {
        echo $Summary;
    }
    }

This doesn’t work because it posts the contents of all <tr class="ismFixtureSummary"> into every <tr class="ismResult">. I am trying to cut them out as a pair.

Thanks for any help you can give.

  • 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-13T17:32:32+00:00Added an answer on June 13, 2026 at 5:32 pm

    Just set the results of your find operation into two separate arrays and then just do a single for loop and echo the results you are looking for.

    include('simple_html_dom.php');
    $url = 'http://www.test.com';
    $html = file_get_html($url);
    
    $FullTable = $html->find('table');
    
    $headings = $FullTable->find('tr[class=ismResult]');
    $summaries = $FullTable->find('tr[class=ismFixtureSummary]');
    
    for ($i = 0; $i < count($headings); $i++;) {
        echo $headings[$i] . $summaries[$i];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to get cut out text effect like this using CSS/CSS3 only?
How can I parse my CSV file without parsing first line ? This class
I would like to make a transparent cut out half circle shape using only
IS it possible to cut out parts of a NSWindow or an NSView and
I want to cut out top of the Primitive Cone in java3d and i
I am trying to figure out a way to cut out a certain region
How to cut part from this string... abb.c.d+de.ee+f.xxx+qaa.+.,,s, ... where i know position by
I'm sure this is a stupid easy question, but with HTML I can never
So this part of the homework wants us to take a Set of Strings
My app will let users cut out things from photos. They'll be able to

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.