Has not been tested or compiled, but one way is create a function that utilizes PHP: DOMDocument and its method getElementsByTagName which returns a 
PHP: DOMNodeList that you can access the node at a specific index.
function grabAttributes($file, $tag, $index) {
 $dom = new DOMDocument();
 if (!@$dom->load($file)) {
   echo $file . " doesn't exist!\n";
   return;
 }
 $list = $dom->getElementsByTagName($tag); // returns DOMNodeList of given tag
 $newElement = $list->item($index)->nodeValue; // initialize variable 
 return $newElement;
}
Eğer ararsanız grabAttributes("myfile.html", "li", 2) değişkeni "Third List" kurulacaktır
Yoksa bir diziye belirli bir etikete tüm özelliklerini koymak için bir işlevi yapabilirsiniz.
function putAttributes($file, $tag) {
$dom = new DOMDocument();
if (!@$dom->load($file)) {
  echo $file . " doesn't exist!\n";
  return;
}
$list = $dom->getElementsByTagName($tag); // returns DOMNodeList of given tag
$myArray = array(); // array to contain values.
foreach ($list as $tag) { // loop through node list and add to an array.
    $myArray[] = $tag->nodeValue;
 } 
   return $myArray;
}
Eğer putAttributes("myfile.html", "li") o array("First List", "Second List", "Third List") dönecekti ararsanız