Forums

  • # November 6, 2012 at 1:00 pm

    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.
    # November 7, 2012 at 2:30 am

    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)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag