는 그래서 같은 배열을 가지고, 그리고 난 같은 저점을 반복하고있다 :Looping Trough Associative Array가 예상대로 작동하지 않습니까?
Value=test
Value=test2
Value=test3
지금 내 배열 및 루프 통에 몇 가지 옵션을 추가 할 :
$options = array();
$options[0] = 'test1';
$options[1] = 'test2';
$options[2] = 'test3';
foreach($options as $x)
{
echo "Value=" . $x ;
echo "<br>";
}
이 예상대로 출력 그들 :
$options = array();
$options['first_option'] = 'test';
$options['second_option'] = get_option('second_option');
$options['third_option'] = get_option('third_option');
foreach($options as $x)
{
echo "Value=" . $x ;
echo "<br>";
}
하지만 내가 원하는대로 작동하지 않습니다. 이 출력되므로 :
Value=first_option
Value=second_option
Value=third_option
을 그래서 지금은이 사람들로부터 foreach는를 사용하여 저장된 값에 액세스하는 방법을 몰라? 뭔가 같은 :
Value=first_option='test'
그래서 print_r($options)
출력을 사용할 때입니다 :
Array
(
[first_options] => test
[second_option] =>
[third_option] =>
)
1
'echo '의 출력을 보여줄 수 있습니까
'; –