2014-02-20 3 views
0

$ iteration_method = 'get_file_object'는 무엇을 의미합니까? 이것은 변수를 선언하고 여기에 문자열 값을 할당하는 것과 동일합니까? 아니면 다른 의미가 있습니까? 아니면 다른 의미가 있습니까? 당신의 청춘 예를 들어, 다른 경우에는 값 'get_file_object'를해야합니다 방법 내부 변수가 통과 가변적이고의 가치를 얻을 방법에 대한 인수를 전달하는 경우php oop 메쏘드에서 변수 선언하기

protected function get_file_objects($iteration_method = 'get_file_object') { 
     $upload_dir = $this->get_upload_path(); 
     if (!is_dir($upload_dir)) { 
      return array(); 
     } 
     return array_values(array_filter(array_map(
      array($this, $iteration_method), 
      scandir($upload_dir) 
     ))); 
    } 

답변

0

That`s 의미;

class test{ 
    public function test($test = 'hello world'){ 
     echo $test; 
    } 
} 

$a = new test(); 
$a->test(); // output hello world 
$a->test('im Michael'); // output im Michael 
+0

감사합니다. @Ziupex - 저것은 제가 알고 싶었습니다. – Muhammad