Skip to content

Instantly share code, notes, and snippets.

@yusufusta
Last active April 24, 2020 11:46
Show Gist options
  • Save yusufusta/4f952fa99b4e91c0f1ab122d5574f127 to your computer and use it in GitHub Desktop.
Save yusufusta/4f952fa99b4e91c0f1ab122d5574f127 to your computer and use it in GitHub Desktop.
Basic php script for get Islam prayer time.
<?php
require_once("shd.php");
$il = $_GET["il"];
$kaynak = @file_get_contents("https://www.mynet.com/$il/namaz-vakitleri");
if ($kaynak === false) {
echo json_encode(["0" => "404"]);
}
$str = str_get_html($kaynak);
$array;
for ($i = 0; $i < 6; $i++) {
$array[$i] = preg_replace("/[^0-9:]+/", "", strip_tags($str->find('div[class=prayer-timeline]')[0]->find("div")[$i]->innertext));
}
echo json_encode($array);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment