안녕 같은 것을 할 수있는 더 좋은 방법이 있다면 난 그냥 궁금 해서요 : 당신의 목표는 PHP의 통지를하지 않도록하는 경우볼 수있는 더 좋은 방법 만약 변수는 isset PHP는
$openid = $_SESSION['openiduserdata'];
if (isset($openid['namePerson/friendly']))
{$username = $openid['namePerson/friendly'];}
if (isset($openid['namePerson/first']))
{$firstname = $openid['namePerson/first'];}
if (isset($openid['namePerson/last']))
{$lastname = $openid['namePerson/last'];}
if (isset($openid['birthDate']))
{$birth = $openid['birthDate'];}
if (isset($openid['contact/postalCode/home']))
{$postcode = $openid['contact/postalCode/home'];}
if (isset($openid['contact/country/home']))
{$country = $openid['contact/country/home'];}
if (isset($openid['contact/email']))
{$email = $openid['contact/email'];}
그것은 당신이 당신의 예제 코드에서 기본적으로 처리하는 방법을 불분명 (나중에 존재를 다시 각 변수를 조사해야 할 것 같습니다). 그러나 개별 if 문 대신 배열 맵을 사용하고자 할 수 있습니다. – mario
나는 질문이있다. 왜 같은 값을 세 번 메모리에 넣어야 하는가? $ _SESSION [ 'openiduserdata'], $ openid 및 $ username 등. – corretge