$site=file_get_contents("$link");
$price='#<span class=price>(.*?)<\/span>#si';
preg_match_all($price,$site,$pricelist);
echo $pricelist[0]."<br>";
echo $pricelist[1]."<br>";
echo $pricelist[2]."<br>";
Hello all, i am new in PHP. i am trying to take price list from another website. I tried to write this code and it said "Notice: Array to string conversion in". How can i take this prices to the list like :
<tr>
<td><?php echo $pricelist[0] ?></td>
<td><?php echo $pricelist[1] ?></td>
<td><?php echo $pricelist[2] ?></td>
<td><?php echo $pricelist[3] ?></td>
<td><?php echo $pricelist[3] ?></td>
</tr>
And also this code worked :
<?php
$site=file_get_contents("$link");
$price='#<span class=price>(.*?)<\/span>#si';
preg_match_all($price,$site,$pricelist);
for ($a=0; $a<5; $a++){
echo $pricelist[1][$a].'<br>'; }
?>