forked from Innoz-Technologies/SMSGyan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NG_leaguetable.php
37 lines (35 loc) · 1.25 KB
/
NG_leaguetable.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
if ($spell_checked == "nigeria league") {
$url = "http://www.completesportsnigeria.com/league/fixtures/1";
$content = file_get_contents($url);
if (preg_match_all('~<td>(.+)</td>~Usi', $content, $match)) {
//var_dump($match[1]);
$data = "Nigeria league Table\n";
for ($i = 8; $i < count($match[1]);) {
$team = $match[1][$i];
$played = $match[1][$i + 1];
$won = $match[1][$i + 2];
$draw = $match[1][$i + 3];
$lost = $match[1][$i + 4];
$gf = $match[1][$i + 5];
$ga = $match[1][$i + 6];
$gd = $match[1][$i + 7];
$points = $match[1][$i + 8];
$data.="Team: $team Played: $played Won: $won Draw: $draw Lost: $lost GF: $gf GA: $ga GD: $gd Points: $points\n";
$i = $i + 9;
}
$data = str_replace(' ', '', $data);
$total_return = $data;
echo $data;
}
if (!empty($total_return)) {
$source_machine = $machine_id;
$current_file = "/temp/$numbers";
file_put_contents(DATA_PATH . $current_file, $total_return);
$to_logserver['source'] = 'NGleague';
include 'allmanip.php';
putOutput($total_return);
exit();
}
}
?>