• 20-11-2013, 19:19:53
    #1
    ÇÖzÜldÜ..
  • 20-11-2013, 19:21:46
    #2
    Neresi gelmiyor yazsaydiniz keske

    Note 2mden gönderdim
  • 20-11-2013, 19:23:10
    #3
    YuqseLX adlı üyeden alıntı: mesajı görüntüle
    Neresi gelmiyor yazsaydiniz keske

    Note 2mden gönderdim
    komple boş sayfa çıkıyor.

    <?php if (function_exists('adanademir')){ adanademir(); } ?>

    fonksiyonu ile çekmeye çalışıyorum yine boş sayfa..
  • 20-11-2013, 19:25:35
    #4
    Satir satir debug edin. Gelen degerleri kontrok etin. Cek fonksiyonu calismiyor olabilir cikti almayi deneyin. Veya parcalamalarda hata olabilir print_r veya var_dump ile arraylari analiz edin.

    Note 2mden gönderdim
  • 20-11-2013, 19:48:29
    #5
    YuqseLX adlı üyeden alıntı: mesajı görüntüle
    Satir satir debug edin. Gelen degerleri kontrok etin. Cek fonksiyonu calismiyor olabilir cikti almayi deneyin. Veya parcalamalarda hata olabilir print_r veya var_dump ile arraylari analiz edin.

    Note 2mden gönderdim
    sonuç yine değişmedi hocam
  • 20-11-2013, 20:18:33
    #6
    Kimlik doğrulama veya yönetimden onay bekliyor.
    @boystar;
    <?php
    	
    	header("Content-Type: text/html; charset=UTF-8");
    	
    	function adanademir() {
    		$URL = "http://www.canliskor.com.tr/futbol/takim/adana-demirspor/6";
    		
    		$response = file_get_contents($URL);
    		
    		if(strlen($response) > 0) {
    			$next_five_match = preg_match_all("#\<div\sclass\=\"wrapper\swell\swell\-none\sspan6\"\>(.*?)\<tbody\>(.*?)\<\/tbody\>#si", $response, $matches) ? $matches[0][1] : null;
    			
    			unset($response);
    			
    			if(!is_null($next_five_match)) {
    				$response = (object) array(
    					"data" => array()
    				);
    				
    				$response->data["title"] = preg_match("#\<h2\sclass\=\"pull\-left\"\>(.*?)\<\/h2\>#si", $next_five_match, $matches) ? trim(end($matches)) : null;
    				
    				$response->data["next_matches"] = array();
    				
    				$tbody = preg_match("#\<tbody\>(.*?)\<\/tbody\>#si", $next_five_match, $matches) ? end($matches) : null;
    				
    				if(!is_null($tbody)) {
    					$tr = preg_match_all("#\<tr\>(.*?)\<\/tr\>#si", $tbody, $matches) ? $matches[1] : null;
    					
    					unset($tbody);
    					
    					foreach($tr as $td) {
    						$td = preg_match_all("#\<td(.*?)\>(.*?)\<\/td\>#si", $td, $matches) ? array_map("trim", array_map("strip_tags", $matches[2])) : null;
    						
    						$response->data["next_matches"][] = (object) array(
    							"date" => html_entity_decode($td[0]),
    							"league" => html_entity_decode($td[1]),
    							"home_team" => html_entity_decode($td[2]),
    							"away_team" => html_entity_decode($td[4])
    						);
    					}
    				}
    				
    				$response->data = (object) $response->data;
    				
    				return $response;
    			} else
    				return null;
    		} else
    			return null;
    	}
    	
    	print_r(adanademir());
    	
    	/*
    		<= OUTPUT =>
    		
    		stdClass Object
    		(
    			[data] => stdClass Object
    				(
    					[title] => GELECEK 5 MAÇ
    					[next_matches] => Array
    						(
    							[0] => stdClass Object
    								(
    									[date] => 23 Kas 19:00
    									[league] => PTT1L
    									[home_team] => Adana Demir.
    									[away_team] => Kahramanma.
    								)
    
    							[1] => stdClass Object
    								(
    									[date] => 30 Kas 14:00
    									[league] => PTT1L
    									[home_team] => İstanbul BŞB
    									[away_team] => Adana Demi.
    								)
    
    							[2] => stdClass Object
    								(
    									[date] => 04 Ara 21:00
    									[league] => TÜK
    									[home_team] => Adana Demir.
    									[away_team] => Bursaspor
    								)
    
    							[3] => stdClass Object
    								(
    									[date] => 08 Ara 19:00
    									[league] => PTT1L
    									[home_team] => Adana Demir.
    									[away_team] => Tavşanlı L.
    								)
    
    							[4] => stdClass Object
    								(
    									[date] => 15 Ara 00:00
    									[league] => PTT1L
    									[home_team] => Fethiyespor
    									[away_team] => Adana Demi.
    								)
    
    						)
    
    				)
    
    		)
    	*/
  • 21-11-2013, 00:13:00
    #7
    saintx üstadın yardımı ile sorun çözülmüştür. Kendisine teşekkürlerimi sunarım.