I am trying to save the song title from the URL: https://onlineradiobox.com/us/977todayshits/playlist
I used the below code to fetch data
$html = file_get_contents("https://onlineradiobox.com/us/977todayshits/playlist");
$matches = array();
$output = preg_match_all('/<table class="tablelist-schedule" role="log">(.*?)<\/table>/s', $html, $matches,PREG_SET_ORDER );
echo "<pre>";
print_r($matches);
echo "</pre>";
The result from the above Code:
Live Mark Ronson - Nothing Breaks Like a Heart (feat. Miley Cyrus)
10:41 Camila Cabello - Consequences
10:38 Imagine Dragons - It's Time
10:34 Panic! at the Disco - High Hopes
10:31 Selena Gomez - Hands to Myself
This code gets the data but I don't know how will I save the 2nd td tag value in a table. It is not necessary that 2nd td will be a link when it is not linked then there is no class defined in td tag.