I have a code of php:
<?php
include('simple_html_dom.php');
$sContent = file_get_contents('http://iztv.com.tr/yayinakisiGunler.aspx?id=1');
$DOM = str_get_html($sContent);
foreach($DOM -> find('table tr') as $tr)
{
$saat = $tr -> find('td', 0)->innertext;
$program = $tr -> find('td', 1)->innertext;
$rating = $tr -> find('td', 2) -> find('img', 0);
if($rating)
{
$rating = $tr -> find('td', 2) -> find('img', 0) -> src;
}
$yayintipi = $tr -> find('td', 2) -> find('img', 1);
if($yayintipi)
{
$yayintipi = $tr -> find('td', 2) -> find('img', 1)->src;
}
$detay = $tr -> find('td', 3) -> find('a', 0);
if($detay)
{
$detay = $tr -> find('td', 3) -> find('a', 0) -> href;
}
$arr['saat'] = $saat;
$arr['program adi'] = $program;
$arr['rating'] = $rating;
$arr['yayin tipi'] = $yayintipi;
$arr['detay'] = $detay;
$arr2[]=$arr;
}
echo json_encode($arr2, true);
?>
When I write the path of php file in browser, it returns proper JSON like I wanted. There is no problem in here. But I want to use whatever link I want like these: "http://iztv.com.tr/yayinakisiGunler.aspx?id=2" or "http://iztv.com.tr/yayinakisiGunler.aspx?id=3" or other links etc.
How can I do that without changing the code and just writing an URL/path to browser?