html stripping

Discussion in 'PHP' started by arunsuriindia, Apr 9, 2007.

  1. #1
    i wanna have all html tags stripped and a file made
    i need the the stripping code.
     
    arunsuriindia, Apr 9, 2007 IP
  2. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #2
    what language are you using?
     
    mopacfan, Apr 9, 2007 IP
  3. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i am using php
     
    arunsuriindia, Apr 9, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    nico_swd, Apr 9, 2007 IP
  5. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Top 5 Losers</title>
    </head>

    <body>

    <table>
    <tr>
    <td vAlign="top" align="right"><br>
    <table cellSpacing="0" cellPadding="0" width="100%" bgColor="#969696" border="0">
    <tbody>
    <tr>
    <td>
    <table cellSpacing="1" cellPadding="4" width="100%" border="0">
    <tbody>
    <tr>
    <td class="tablehead" colSpan="9">Top 5 Losers</td>
    </tr>
    <tr align="middle">
    <td class="specialhead2">Symbol</td>
    <td class="specialhead2">Open</td>
    <td class="specialhead2">High</td>
    <td class="specialhead2">Low</td>
    <td class="specialhead2">Prev. Close</td>
    <td class="specialhead2">Last Price</td>
    <td class="specialhead2"><nobr>% Change</nobr></td>
    <td class="specialhead2"><nobr>Last Ex-date &nbsp;&nbsp;</nobr></td>
    <td class="specialhead2">Last<br>
    Corporate Action</td>
    </tr>
    <tr>
    <td class="t0"><a href="http://nseindia.com/marketinfo/equities/cmquote.jsp?key=BPCLEQN&amp;symbol=BPCL&amp;flag=0">BPCL</a></td>
    <td class="t1">320.30</td>
    <td class="t1">320.30</td>
    <td class="t1">301.10</td>
    <td class="t1">312.65</td>
    <td class="t1">302.75</td>
    <td class="t1">-3.17</td>
    <td class="t0">15-JAN-07</td>
    <td class="t0">INTERIM DIVIDEND - 60%</td>
    </tr>
    <tr>
    <td class="t0"><a href="http://nseindia.com/marketinfo/equities/cmquote.jsp?key=HCLTECHEQN&amp;symbol=HCLTECH&amp;flag=0">HCLTECH</a></td>
    <td class="t1">300.40</td>
    <td class="t1">302.80</td>
    <td class="t1">284.00</td>
    <td class="t1">300.40</td>
    <td class="t1">291.40</td>
    <td class="t1">-3.00</td>
    <td class="t0">15-MAR-07</td>
    <td class="t0">BONUS 1:1</td>
    </tr>
    <tr>
    <td class="t0"><a href="http://nseindia.com/marketinfo/equities/cmquote.jsp?key=JETAIRWAYSEQN&amp;symbol=JETAIRWAYS&amp;flag=0">JETAIRWAYS</a></td>
    <td class="t1">647.35</td>
    <td class="t1">663.00</td>
    <td class="t1">628.00</td>
    <td class="t1">650.15</td>
    <td class="t1">633.20</td>
    <td class="t1">-2.61</td>
    <td class="t0">07-SEP-06</td>
    <td class="t0">AGM/DIV-RS.6/- PER SH</td>
    </tr>
    <tr>
    <td class="t0"><a href="http://nseindia.com/marketinfo/equities/cmquote.jsp?key=HDFCEQN&amp;symbol=HDFC&amp;flag=0">HDFC</a></td>
    <td class="t1">1535.90</td>
    <td class="t1">1539.95</td>
    <td class="t1">1501.25</td>
    <td class="t1">1537.85</td>
    <td class="t1">1519.80</td>
    <td class="t1">-1.17</td>
    <td class="t0">30-JUN-06</td>
    <td class="t0">AGM/DIV-RS.20/- PER SH</td>
    </tr>
    <tr>
    <td class="t0"><a href="http://nseindia.com/marketinfo/equities/cmquote.jsp?key=TCSEQN&amp;symbol=TCS&amp;flag=0">TCS</a></td>
    <td class="t1">1248.35</td>
    <td class="t1">1254.80</td>
    <td class="t1">1220.25</td>
    <td class="t1">1248.35</td>
    <td class="t1">1233.85</td>
    <td class="t1">-1.16</td>
    <td class="t0">22-JAN-07</td>
    <td class="t0">3RD INT DIV-RS.3/- PER SHPURPOSE REVISED</td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    <!-- <tr><td colspan=3 class=smalllinks><ul><li>% change is w.r.t. Prev. Close</li><li>If today is Ex-Date, % change is w.r.t. Open Price</li></ul></td></tr> -->
    </table>

    </body>

    </html>
     
    arunsuriindia, Apr 9, 2007 IP
  6. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i want to convert the above code to text file and then upload it into mysql
     
    arunsuriindia, Apr 9, 2007 IP
  7. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #7
    You want to strip out the HTML of the code above, create a flat file of it, and then save it into a database? So you'll have the flat file and the database entry? And how do you want to strip the tags? It's gonna look weird the text without HTML. Do you want a specific part of this HTML code?
     
    nico_swd, Apr 9, 2007 IP
  8. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    yes i want the table in csv format
     
    arunsuriindia, Apr 9, 2007 IP
  9. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #9
    Okay, now please use full sentences, and explain very detailed what exactly you want to do. And answer all my questions above. I can not guess what you want to do.

    EDIT:

    Okay, after some thinking, maybe I get what you mean.
     
    nico_swd, Apr 9, 2007 IP
  10. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    can u have a look at the html file made by this code.

    I want the table which contains 51 rows in csv format(ie i save the required data as file.csv).
    now the format of the data should be


    data in cell,data in cell,data in cell;


    "," seperates the data in the table
    ";" ends the line
     
    arunsuriindia, Apr 9, 2007 IP