Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Simple HTML DOM Parser [HELP]

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40647
    salmansale
    Member

    Hey,

    I am working on an app in which I am using [PHP Simple HTML DOM Parser](http://simplehtmldom.sourceforge.net/ “”). Now what is I have for example following HTML which I have fetched in sting:

    <table>
    <tbody>
    <tr>
    <th>Column1</th>
    <th>Column2</th>
    <th>Column3</th>
    </tr>
    <tr>
    <td><a href=”#”>First Link</a></td>
    <td>Some content here
    <td><a href=”#”>Another Link</a></td>
    </tr>
    <tr>
    <td><a href=”#”>First Link</a></td>
    <td>Some content here
    <td><a href=”#”>Another Link</a></td>
    </tr>
    </tbody>
    </table>

    Now what I want is to fetch first link of every

    element and echo it’s src on screen.
    #113544
    salmansale
    Member

    I have tried this kind of code including this one which you posted but it is showing:

    > Invalid argument supplied for foreach()

    as what I understand that when we are finding first occurrence of

    we can’t make it in loop.
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.