I have some content it another website that i would like to show my users, i use file get content function.
but i dont need to display the whole content, just two rows, The current product and the next product. the content is arranged with html tables.
my code:
<?php
$url = "http://the second website.com";
$str = file_get_contents($url);
$lines = explode("<tr>", $str);
foreach ($lines as $newline) {
echo '<tr>' . $newline . '</tr>'; -- This prints all lines.
}
?>
How to echo only the specific lines ? My needed line are start with the strings "current product" and "next product". Do i need to use an array ? or do in need to use a search string function ?
Thanks all.