I'm trying to embed the code of the link below in my own website:
But the problem is that the link is dynamically generated & its trailer changes on a daily basis. How can I extract the tabular data from the link using PHP
language.
You can use date('d/m/Y') for this with curl.
<?php
$url = 'http://razpisanie.bdz.bg/SearchServlet?action=listStationNew&station=%D0%94%D0%A3%D0%9F%D0%9D%D0%98%D0%A6%D0%90&date=';
$url = $url.date('d/m/Y');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
More info from date: https://secure.php.net/manual/en/function.date.php More info from curl: https://secure.php.net/manual/en/function.curl-error.php
If your and the razpisanie's server clock don't use same time and date you will get time issue, because you will get a not existing date url when razpisanie's server dont change date.