1. Go to this page and download the library: Download ndunks/php-simple-protobuf 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/ */
`
/ Class Simple compiled from simple.proto (find on test/proto)
$obj = new Simple();
$obj->setName('user');
$obj->setAddress('Indonesia');
$obj->setAge(25);
$obj->toArray(); // as PHP Array
$obj->toJson(); // as JSON formated string
git clone https://github.com/ndunks/php-simple-protobuf
cd php-simple-protobuf
composer dump-autoload
# if output directory not exist, you must create it manualy
mkdir result
# Compile it
php bin/compiler.php --out=result --file=test/proto/simple.proto
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.