라이브러리

[PHP] Yaf_Config_Simple::next - 다음 목적




Yaf_Config_Simple::next


Yaf_Config_Simple::next는 Yaf_Config_Simple 객체에서 다음 설정을 반환하는 메서드입니다. 이 메서드는 현재 설정을 반환하고, 다음 설정으로 이동하여 반환합니다.

# 사용법


Yaf_Config_Simple::next 메서드는 다음과 같이 사용할 수 있습니다.

#hostingforum.kr
php

$config = new Yaf_Config_Simple(array(

    'database' => array(

        'host' => 'localhost',

        'username' => 'root',

        'password' => 'password',

        'name' => 'database'

    ),

    'server' => array(

        'host' => 'localhost',

        'port' => 80

    )

));



while ($config->next()) {

    $section = $config->getName();

    $value = $config->getValue();

    echo "Section: $section, Value: $value
";

}



# 예제


위의 예제에서 `Yaf_Config_Simple` 객체를 생성하고, `next` 메서드를 사용하여 설정을 순회합니다. 각 설정은 이름과 값으로 구성되며, `getName` 메서드를 사용하여 이름을 얻고, `getValue` 메서드를 사용하여 값을 얻습니다.

# 결과


#hostingforum.kr


Section: database, Value: Array ( [host] => localhost [username] => root [password] => password [name] => database )

Section: server, Value: Array ( [host] => localhost [port] => 80 )



# 참고


Yaf_Config_Simple::next 메서드는 현재 설정을 반환하고, 다음 설정으로 이동하여 반환합니다. 이 메서드는 설정을 순회할 때 사용할 수 있습니다. 또한, `getName` 메서드를 사용하여 설정 이름을 얻고, `getValue` 메서드를 사용하여 설정 값을 얻을 수 있습니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 8,985건 / 25 페이지

검색

게시물 검색