my php code is below
<?php
$url="http://dsebd.org/latest_share_price_all.php";
$abc=file_get_contents($url);
// Example 1
$pieces = explode('tr', $abc);
echo "<table border=\"1\">";
echo "<tr".$pieces[1]; // piece2
echo "<tr".$pieces[2]; // piece1
echo "<tr".$pieces[3]; // piece2
echo "<tr".$pieces[4]; // piece1
echo "<tr".$pieces[5]; // piece2
echo "</table>";
?>
I tried tho split the table. the table is bangladesh stock exchange.
but in the page extra << is printing before table
Why? can anybody help me
extra "<<" in my php code output why
Moderator: General Moderators
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: extra "<<" in my php code output why
Echo $pieces[1], $pieces[2] etc and see what you find. These presumably contain the info necessary to complete each table row eg <td>...</td></tr>. If there is an extra < on the end of the row after the closing </tr>, then it will be printed before the table. My guess is that you may need to explode on "<tr" and not on "tr".