tkijewski / php-lnurl
PHP implementation of lnurl Spec
Installs: 13 715
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 2
Forks: 1
Open Issues: 1
Requires
Requires (Dev)
- phpunit/phpunit: ^5.4.0
- squizlabs/php_codesniffer: ^2.0.0
This package is auto-updated.
Last update: 2024-11-20 22:03:33 UTC
README
PHP implementation of the lnurl
protocol https://github.com/fiatjaf/lnurl-rfc
Uses the bech32 library https://github.com/Bit-Wasp/bech32
Installation
$ composer require tkijewski/php-lnurl
Usage
<?php
require __DIR__ . '/vendor/autoload.php';
use tkijewski\lnurl;
$lnurl = lnurl\encodeUrl('https://paywall.link?someIdentifier=292e29j29j19nd91m2mfmmurn843&tag=withdraw');
//LNURL1DP68GURN8GHJ7URP09MKZMRV9EKXJMNT8AEK7MT9F9JX2MN5D9NXJETJ85ERJVN9XGUK5V3EDGCNJMNY8YCK6VNDVEKK6ATJDCURGVEXW3SKW0THD96XSERJV9MS95LDUW
print_r( lnurl\decodeUrl($lnurl) );
/*
* [
* 'url' => 'https://paywall.link?someIdentifier=292e29j29j19nd91m2mfmmurn843&tag=withdraw',
* 'tag' => 'withdraw'
* 'someIdentifier' => '292e29j29j19nd91m2mfmmurn843'
* ]
*/
Test
$ vendor/bin/phpunit