mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-24 05:35:51 +00:00
Content for getting-started-in-php.md and send-xrp.md
This commit is contained in:
18
content/_code-samples/get-started/php/base.php
Normal file
18
content/_code-samples/get-started/php/base.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
// Use the Composer autoloader
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// Imports
|
||||
use XRPL_PHP\Client\JsonRpcClient;
|
||||
use XRPL_PHP\Wallet\Wallet;
|
||||
use function XRPL_PHP\Sugar\fundWallet;
|
||||
|
||||
// Create a client using the Testnet
|
||||
$client = new JsonRpcClient("https://s.altnet.rippletest.net:51234");
|
||||
|
||||
// Create a new wallet
|
||||
$wallet = Wallet::generate();
|
||||
|
||||
// Fund (and activate) the wallet
|
||||
fundWallet($client, $wallet);
|
||||
Reference in New Issue
Block a user