3v4l.org

run code in 300+ PHP versions simultaneously
<?php function SaveFile($TYPE,$dataset,$lang) { // Para substituir acentos e cedilhas $patterns[0] = '/[á|â|à|å|ä]/'; $patterns[1] = '/[ð|é|ê|è|ë]/'; $patterns[2] = '/[í|î|ì|ï]/'; $patterns[3] = '/[ó|ô|ò|ø|õ|ö]/'; $patterns[4] = '/[ú|û|ù|ü]/'; $patterns[5] = '/ç/'; $replacements[0] = 'a'; $replacements[1] = 'e'; $replacements[2] = 'i'; $replacements[3] = 'o'; $replacements[4] = 'u'; $replacements[5] = 'c'; //ficheiros em minusculas e sem espacos e em HTML e em Ingles e PT $TYPE2 = strtolower(str_replace (" ", "", $TYPE)); $myFile = "files/".$TYPE2."_".$lang.".php"; $myFile2 = preg_replace($patterns, $replacements, $myFile); $fh = fopen($myFile2, 'a'); //fwrite($fh, "<link rel=\"stylesheet\" type=\"text/css\" href=\"livestream.css\">\n"); //fwrite($fh, "<table>\n"); fwrite($fh, $dataset); //fwrite($fh, "</table>\n"); fclose($fh); } // DEFINIR IDIOMA $LANG=$_REQUEST["lang"]; // EN=1 // PT=22 if($LANG=="pt" OR $LANG==""){ $LANG="22"; $WATCHHERE="Veja aqui"; $link="http://imstore.bet365affiliates.com/Tracker.aspx?AffiliateId=16136&AffiliateCode=365_022055&CID=360&PID=149&TID=3&LNG=22&DID=27"; } if($LANG=="en"){ $LANG="1"; $WATCHHERE="Watch here"; $link="http://imstore.bet365affiliates.com/Tracker.aspx?AffiliateId=16136&AffiliateCode=365_044431&CID=360&PID=149&TID=3&LNG=1&DID=27"; } $dom = new DomDocument; $dom->preserveWhiteSpace = TRUE; $dom->load( 'http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId='.$LANG ); $params = $dom->getElementsByTagName('Event'); // Find Sections $k=0; foreach ($params as $param) //go to each section 1 by 1 { $JOGO = utf8_decode($params->item($k)->getAttribute('EventName')); $EVENTSTART = $params->item($k)->getAttribute('EventStart'); $TYPE_ID = $params->item($k)->getAttribute('ClassificationID'); $TYPE = utf8_decode($params->item($k)->getAttribute('Classification')); $EVENTGROUP = $params->item($k)->getAttribute('EventGroup'); if (preg_match("/portugal/i", $EVENTGROUP)) { $BOLD1="<b>"; $BOLD2="</b>"; } else { $BOLD1=""; $BOLD2=""; } $datetime = new DateTime("$EVENTSTART"); $DATA= $datetime->format('d-m-Y'); $HORA= $datetime->format('H:i'); $i = 0; do { if($TYPE_ID==$i) { $dataset = "<tr><td align='left'>$BOLD1 $DATA - $HORA</td><td align='left'>$BOLD1 $JOGO</td><td align='left'><a target='_blank' href='$link'>$BOLD1 $WATCHHERE $BOLD2</a></td></tr>\n"; SaveFile($TYPE, $dataset, $LANG); } ++$i; } while ($i < 500); $k++; } ?>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Undefined array key "lang" in /in/6CR86 on line 30 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo for oddsfeed.bet365.com failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22): Failed to open stream: php_network_getaddresses: getaddrinfo for oddsfeed.bet365.com failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22" in /in/6CR86 on line 47
Output for 8.0.13 - 8.0.30
Warning: Undefined array key "lang" in /in/6CR86 on line 30 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22): Failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22" in /in/6CR86 on line 47
Output for 8.0.0 - 8.0.12
Warning: Undefined array key "lang" in /in/6CR86 on line 30 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/6CR86 on line 47 Warning: DOMDocument::load(http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22): Failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/6CR86 on line 47 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22" in /in/6CR86 on line 47
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1, 7.4.0, 7.4.26 - 7.4.33
Notice: Undefined index: lang in /in/6CR86 on line 30 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22" in /in/6CR86 on line 47
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.25
Notice: Undefined index: lang in /in/6CR86 on line 30 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/6CR86 on line 47 Warning: DOMDocument::load(http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/6CR86 on line 47 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22" in /in/6CR86 on line 47
Output for 7.3.32 - 7.3.33
Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/6CR86 on line 47 Warning: DOMDocument::load(): I/O warning : failed to load external entity "http://oddsfeed.bet365.com/DiaryStreaming.aspx?LanguageId=22" in /in/6CR86 on line 47

preferences:
211.25 ms | 402 KiB | 293 Q