<?php
$whitelist = array('contact', 'about', 'user');
$_GET['page'] = array('contact');
$test = $_GET['page'];
if(isset($test))
{
if(in_array($whitelist, $test))
{
$got = $test;
echo $got;
}
else
{
$got = 'home';
echo $got;
}
}
?>
이제 여기에 '연락처'로 결과가 표시되지만 '집'이 표시됩니다. 왜 그런가요?in_array()를 이해할 수 없습니다.
것 같습니다 = "접촉" –