PHP code example of phoenyx-studio / parser

1. Go to this page and download the library: Download phoenyx-studio/parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phoenyx-studio / parser example snippets

$php


<html>
  <head>
   <title>Parser test app</title>
  </head>
 <body>
  <div class="content">
   <h1>This is the header of test app</h1>
   <ul>
     <li>This is the first list item</li>
     <li>This is the second list item</li>
     <li>This is the third list item</li>
   </ul>
  </div>
 </body>
</html>';

$parser = new PhoenyxStudio\Parser\FakeParser();

$parseResult = $parser->parse($html);

$doc = $parseResult->ejectObject();

foreach($doc->getListItems() as $listItem) {
    echo $listItem . '<br>';
}