Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17136 программистов и 1833 робота. Сейчас ищут 1692 программиста ...
XML_RDDL::getResourcesByLanguage
Вернуться к: XML_RDDL
XML_RDDL::getResourcesByLanguage
XML_RDDL::getResourcesByLanguage() – selects all resources of a specified language
Synopsis
require_once 'XML/RDDL.php';
array XML_RDDL::getResourcesByLanguage ( string $language )
Gets all resources of a given language from an RDDL document. You have to call XML_RDDL::parseRDDL() first. If a resource has no xml:lang attribute, the xml:lang attribute of the root of the document is used.
Parameter
-
string $language - language of the resources you want to get.
Return value
array array containing all resources with the specified language.
Note
This function can not be called statically.
Getting all english resource
<?php
require_once "XML/RDDL.php";
// create new parser
$rddl = &new XML_RDDL();
// parse a document that contains RDDL resources
$result = $rddl->parseRDDL('http://www.rddl.org');
// check for error
if (PEAR::isError($result)) {
echo sprintf( "ERROR: %s (code %d)", $result->getMessage(), $result->getCode());
exit;
}
// get all english resources
$en = $rddl->getResourcesByLanguage('en');
echo "<pre>";
print_r($en);
echo "</pre>";
?>
Вернуться к: XML_RDDL