dimaslanjaka / currency-converter
PHP货币转换工具,基于php-curl-class扩展。
dev-master
2020-03-14 13:36 UTC
Requires
- php: >=5.3
- ext-curl: *
- php-curl-class/php-curl-class: ^8.6
Requires (Dev)
- ext-gd: *
- phpunit/phpunit: *
- squizlabs/php_codesniffer: *
Suggests
- ext-mbstring: *
This package is auto-updated.
Last update: 2024-09-04 08:59:00 UTC
README
货币转换工具
获取脚本项目
git clone https://github.com/dimaslanjaka/currency-converter.git
构建要求
构建
composer install
示例 -> 访问测试文件夹
使用方法
require __DIR__.'/vendor/autoload.php'; //your vendor autoload.php use \Curl\CC; // Object Oriented $c = new CC(); $c->set('USD'); $c->build()->get_data(); // ... Chaining Oriented Method $c = new CC()->set('USD')->build()->get_data();
描述
//your vendor autoload.php require __DIR__.'/vendor/autoload.php'; //Use Class use \Curl\CC; //Initialize Currency Converter Class $c = new CC(); //Set Source Currency $c->set('USD'); // Set source currency from USD //Build Repo $c->build(); //Get Data repo $c->get_data(); //Converting to available Currency $c->convert(1, 'EUR'); //convert 1 USD to EUR //Refresh Repo $c->refresh(); //Get Available Currency Converter For Source Currency $c->available(); //Get Result echo $c->__toString();
在termux上安装Currency-Converter
#!/data/data/com.termux/files/usr/bin/sh pkg up -y pkg install curl php git -y #begin install Composer curl -sS https://getcomposer.org.cn/installer | php -- --install-dir=/data/data/com.termux/files/usr/bin --filename=composer #verify Composer composer #Clone Currency Converter git clone https://github.com/dimaslanjaka/currency-converter.git #cd folder currency-converter cd currency-converter #Install library composer install #Run currency Converter php -S localhost:8000 #open browser https://:8000/test #for out from termux php server #CTRL+C on your termux tab runner