PHP code example of smallsung / ethereum-php
1. Go to this page and download the library: Download smallsung/ethereum-php 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/ */
smallsung / ethereum-php example snippets
composer
$result = $client->contracts->test_contract->call('test_function', ['test_arg_1', 'test_arg_2']);
$client->contracts->test_contract->watch('Event1', function (\Ethereum\Types\Event $data) {
var_dump($data);
});
echo $client->eth()->protocolVersion();
echo $client->web3()->clientVersion();
echo $client->net()->version();