I want to replace <a> tag contents from PHP Variable ($html_content)...
The Variable $html_content Value looks like below:
$html_content= "<table>
<thead>
<tr><th>Customer</th><th>Age</th><th>A</th></tr>
</thead>
<tbody>
<tr><td>Test 1</td><td>25</td><td><a href='www.google.com'>Link</a></td></tr>
<tr><td>Test 2</td><td>30</td><td><a href='www.yahoo.com'>Link</a></td></tr>
<tr><td>Test 3</td><td>31</td><td><a href='www.rediff.com'>Link</a></td></tr>
...
...
...
</tbody>
</table>
I want to replace content in string every last <td> content of every <tr> which contains <a> tag.
The sample rows result:
<tr><td>Test 1</td><td>25</td><td>Action will be taken soon.</td></tr>
<tr><td>Test 2</td><td>30</td><td>Action taken yesterday</td></tr>
...
...
I need result to replace every row with different content values. The content is taken from table. The particular customer action only i want to replace.
CUSTOMER TABLE:
------------------------------------------------------
id customer age action
------------------------------------------------------
1 Test 1 25 Action will be taken soon
2 Test 2 30 Action taken yesterday
3 Test 3 31 Action will take tomw
4 Kumar 28 Suspended
...
...
...
------------------------------------------------------
using this table i have shown filtered result in one page without action description instead of <a> tag. (This result is part of that page named reports.php).
I want to export these records only with action field description to PDF(I'm using HTML to PDF class).
In that page i had sent to these HTML values to that page and storing in PHP Variable($html_content) in export_pdf.php page...
The table records is not fixed size... It's based on generating result from sorting.
Please anyone help me... Thanks in advance...