fork download
  1. <?php
  2. $html = <<<HTML
  3. <OPTION value=a.a.>Afaceri</OPTION>
  4. <OPTION value=a.b.>Mass Media</OPTION>
  5. <OPTION value=a.c.>Publicitate</OPTION>
  6. <OPTION value=b.a.>Agricultura</OPTION>
  7. HTML;
  8.  
  9. $dom = new DOMDocument();
  10. $dom->loadHTML($html);
  11. $nodes = $dom->getElementsByTagName('option');
  12.  
  13. $result = array();
  14. foreach ($nodes as $node) {
  15. $result[] = $node->nodeValue;
  16. }
  17.  
  18. var_dump($result);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
array(4) {
  [0]=>
  string(7) "Afaceri"
  [1]=>
  string(10) "Mass Media"
  [2]=>
  string(11) "Publicitate"
  [3]=>
  string(11) "Agricultura"
}