Last active
April 24, 2020 11:46
-
-
Save yusufusta/4f952fa99b4e91c0f1ab122d5574f127 to your computer and use it in GitHub Desktop.
Basic php script for get Islam prayer time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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