Skip to content

visol/idx-reader

Repository files navigation

IDX Reader

Library to read and parse IDX data. Internet Data Exchange (IDX) is a standard to describe properties such as houses, appartment, etc... commonly used in the real estate industry.

Usage

$contents = file_get_contents('sample.idx');
$reader = new Visol\IdxReader\IdxReader();
$reader->load($contents);

We can also load a dataset from a file:

$reader = new Visol\IdxReader\IdxReader()
$reader->loadFromFile('sample.idx');

We can retrieve all records or count them:

// Returns an array of records
$reader->getRecords();

// Returns an integer
$reader->countRecords();

Complete example:

$reader = new Visol\IdxReader\IdxReader()
$reader
    ->forceUtf8()
    ->loadFromFile('sample.idx')
    ->getRecords();

Contribute

Contributions to the package are always welcome!

Unit Tests

To run the unit tests simply:

./phpunit tests

License

All contents of this package are licensed under the MIT license.