PHP code example of sedovsg / fias-dbf

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

    

sedovsg / fias-dbf example snippets


use Fias\Dbf;

$dbf = (new Dbf('dir_name'));

$result = $dbf->
  select()->
  from('STRSTAT.DBF')->
  exect()->
  fetchAll();

  $result = $dbf->
      select()->
      from('STRSTAT.DBF')->
      exect()->
      rowCount();

  $result = $dbf->
      select()->
      from('FLATTYPE.DBF')->
      exect()->
      getFieldsInfo();

  $result = $dbf->
      select()->
      from('ACTSTAT.DBF')->
      exect()->
      numFields();

  $result = $dbf->
      select()->
      from('FLATTYPE.DBF')->
      exect()->
      getFields();

  $result = $dbf->
      select()->
      from('STRSTAT.DBF')->
      equal('STRSTATID = 2, NAME = Литер')->
      exect()->
      fetch();

  $result = $dbf->
      select()->
      from('STRSTAT.DBF')->
      exclude('STRSTATID = 1')->
      exect()->
      fetch();

  $result = $dbf->
      select()->
      from('ESTSTAT.DBF')->
      

  $result = $dbf->
      select('STRSTATID, NAME')->
      select('SHORTNAME')->
      from('STRSTAT.DBF')->
      

  $result = $dbf->
      select('STRSTATID, NAME')->
      select('SHORTNAME')->
      from('STRSTAT.DBF')->
      

$dbf->download();

$dbf->update();

$dbf->сlose();
bash
$ sudo pecl install package_name;
$ echo "extension=/usr/lib/php/20170718/package_name.so" | sudo tee /etc/php/7.2/mods-available/package.ini;
$ sudo ln -s /etc/php/7.2/mods-available/package_name.ini /etc/php/7.2/cli/conf.d/;
$ sudo ln -s /etc/php/7.2/mods-available/package_name.ini /etc/php/7.2/apache2/conf.d/