2014-02-11 1 views
0

나는 라인이 아닌 객체() 멤버 함수의 발견에 오류를전화는 (423)

전화를 받고 있어요 (423)

내가 테스트하고 작동했기 때문에 URL에 배열의 키가 있다는 것을 알고 있습니다. 또한 423에 코드 줄을 사용하고 잘 작동했습니다. 여기

코드 샘플

$oppo_team = array(teams::$ars_fixtures=>'Arsenal', teams::$manc_fixtures=>'Manchester City', teams::$che_fixture=>'Chelsea', teams::$liv_fixture=>'Liverpool', teams::$tott_fixture=>'Tottenham', teams::$eve_fixture=>'Everton', teams::$manu_fixture=>'Manchester United', teams::$newc_fixture=>'Newcastle United', 
    teams::$south_fixture=>'Southampton', teams::$swan_fixture=>'Swansea City', teams::$ast_fixture=>'Aston Villa', teams::$nor_fixture=>'Norwich City', teams::$hull_fixture=>'Hull City', teams::$cry_fixture=>'Crystal Palace', teams::$westb_fixture=>'West Bromwich Albion', teams::$stoke_fixture=>'Stoke City', 
    teams::$westh_fixture=>'West Ham United', teams::$ful_fixture=>'Fulham', teams::$sun_fixture=>'Sunderland', teams::$carc_fixture=>'Cardiff City'); 


for ($i=0; $i < $lengthgp; $i++) { 
# code... 
    if(!preg_match('/'.$home_team[$i].'/i', $team)){ 
     if($i == 0){ 

     }else if($i > 0){ 

     } 

    }else{} 

    if(!preg_match('/'.$away_team[$i].'/i', $team)){ 
     if($i == 0){ 

     }else if($i > 0){ 
     echo $oppaway[] = array_search($away_team[$i], $oppo_team); 
      //}else{ 

      //} 

      $oppfix = file_get_html($oppaway); 

      //Collect scores from the sites table 

      for($score = 1;$score<114;$score+=3){ 
      // Find within td a 
    LINE 423----> $oppa_scores = $oppfix->find('td a', $score); 
      //store in array 
       $oppgame_scores[] = $oppa_scores->plaintext; 
      } 

키를 별도의 클래스에 링크되는 배열을 추가합니다. $oppaway이 URL 인 경우

+0

위해서 var_dump ($의 oppfix) 우리에게이 – paquino

+0

그것은 내가 $의 AWAY_TEAM을 var_dumped 및 목록 – user3210416

+0

부울 반환, 나는 – user3210416

답변

0

내가 알게 된 사실은 simple_html_dom에 가끔 URL을 사용할 수 있는지 여부를 확인해야한다는 것입니다. (그 목적은?) 반환되는 것을

$oppfix = file_get_html($oppaway); 

if(!exist($oppfix)){ 

     //Collect scores from the sites table 

     for($score = 1;$score<114;$score+=3){ 
     // Find within td a 
LINE 423----> $oppa_scores = $oppfix->find('td a', $score); 
     //store in array 
      $oppgame_scores[] = $oppa_scores->plaintext; 
     } 
}else{ 
//Do SOMETHING 
} 
0

, 다음 file_get_html에 인수해야

+0

같은 오류가 나온 거짓 – user3210416

+0

위 내 배열을 추가하면 $ oppaway가 유효한 URL인지 확인해야합니다. – paquino

0

당신이 포함 된 클래스와 $ oppfix의 인스턴스를 생성 한 적이 문자열을

echo $oppaway[] = array_search($away_team[$i], $oppo_team); 

echo $oppaway = array_search($away_team[$i], $oppo_team); 

변경 방법 "찾기"?