2012-08-24 3 views
-1

내가 PHP를 배우려고 노력하고 내가 잘못된 값을 반환변수의 내용

public function pdf_read_root() 
{ 
    $this->root = $this->pdf_resolve_object($this->c, $this->pdf_find_root()); 

} 

하지만 $this->root이 기능이 내 배열 나쁜 키를 필요없이이 문제를 우연히 발견하고, 나는 어떻게받을 수 있나요하기 각각의 내용은, $this->c & $this->pdf_find_root는 "잘못된 값"을 정의 할 수

+0

pdf_resolve_object에 사용되는 것을 볼 수? –

+0

내가 원하고있는 키가 잘못되어 따라서 $ this-> root [1] [ '/ Pages']와 같은 검사를 할 때 성공하지 못합니다. –

+2

print_r() 함수를 호출하여 내부인지 여부는 객체인지 배열인지에 관계없이 그것은 당신이 잘못 생각하는 것을 디버깅하는 데 도움을 줄 수 있습니다. – Stegrex

답변

3
public function pdf_read_root() 
{ 

    $this->root = $this->pdf_resolve_object($this->c, $this->pdf_find_root()); 
    echo "<pre>"; 
    echo "<br> Value of member variable c is: ". print_r($this->c, true); 
    echo "<br> Value of method pdf_find_root() is: ". print_r($this->pdf_find_root(),true); 
    echo "<br> Value of member variable root is: ". print_r($this->root, true); 
    echo "</pre>"; 

} 
+2

이것은 대답이 아니라 디버깅을위한 제안처럼 보입니다. –

+0

그것이 OP가 요청한 것입니다. 제목을 읽으십시오. – raidenace

+0

네, 사실입니다. –