#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    How to replace string/ word in parsing html with php?


    i have table like

    <html>
    <body>
    <table id="data" class="outer">
    <tr><td>Date</td><td>12-09-12</td></tr>
    <tr><td>Price</td><td>15.00</td></tr>
    <tr><td>Count</td><td>67</td></tr>
    </table>
    </body>
    </html>

    i have to parse this to give out put for more than 100 but i am unable to get how value for "Date" "12-09-12" can be replaced with new value from database value.

    please give me a small example

    $html = new simple_html_dom();
    $html->load_file($page);

    $items = $html->find('Date');
    can anyone help me ?
  2. #2
  3. Disturbed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Somewhere In the Great Unknown
    Posts
    495
    Rep Power
    13
    So are you wanting to turn 20-10-12 into 2012-10-20?
    Put your hand on a hot stove for a minute, and it seems like an hour.
    Sit with a pretty girl for an hour and it seems like a minute.
    That's relativity.
    - Albert Einstein

    while($girl=='ugly')
    {
    $alcohol++;
    }
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2009
    Posts
    13
    Rep Power
    0
    Why are you getting the entire HTML as a string. Please explain exactly what you are doing and why. There is probably a better way to get that table info.

IMN logo majestic logo threadwatch logo seochat tools logo