-1
Well, basically what I need is to do a microservice that extracts the prices from the soybean quotation from this table: https://www.canalrural.com.br/cotacao/soja/. And then insert the data into a database. Although I can scraping using the code below, I have no idea how to "filter" the data of the array to include in the database structure.
$content = file_get_contents('https://www.canalrural.com.br/cotacao/soja/');
preg_match_all('/<table class="table table-striped table-cotacao first-col-small table-menor">(.*?)(.*?)<\/div>/s',$content,$matches);
foreach ($matches[0] as $key => $value){
echo $value;
echo '<hr>';
}
Database columns are only the location and price.