PHP code example of fiv / tokenizer

1. Go to this page and download the library: Download fiv/tokenizer 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/ */

    

fiv / tokenizer example snippets


  $fileTokens = new Fiv\Tokenizer\File(__FILE__);
  $query = $fileTokens->getCollection()->extendedQuery();
  $query->strict()->valueIs(array('if', 'elseif'));
  $query->section('(', ')');

  $blocks = $query->getBlock();
  foreach ($blocks as $code) {
    echo $code . "\n";
  }