PHP code example of ljmaskey / php-cmf-bindings
1. Go to this page and download the library: Download ljmaskey/php-cmf-bindings 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/ */
ljmaskey / php-cmf-bindings example snippets
$bytes = [];
$builder = new MessageBuilder($bytes, 0);
$builder->addString(CITY_NAME_TAG, 'Paris');
$builder->addInt(CITY_POPULATION_TAG, 2229621);
$builder->addDouble(CITY_AREA_TAG, 105.6);
$parser = new MessageParser($inputStream, 0, $inputStreamLength);
while ($parser->next() == State.FoundTag) {
if ($parser->tag() == CITY_POPULATION_TAG) {
$population = $parser->getInt();
break;
}
}