이 루프를 제한하여 6 개의 값만 얻으려면 어떻게해야합니까? 루프 밖으로이 루프를 특정 번호로 제한하려면 어떻게합니까?
$countries = array();
foreach ($my_data as $node)
{
foreach($node->getElementsByTagName('a') as $href)
{
$countries[] = strip_tags(trim($href->nodeValue));
}
}
당신의 getElementsByTagName ('는이')는 PHP 함수이다합니까? 어디에서 정의 했습니까? –
@Eric ['DOMDocument :: getElementsByTagName'] (http://php.net/manual/en/domdocument.getelementsbytagname.php) – lonesomeday