mejoh/mejoh-library

该软件包最新版本(dev-main)没有可用的许可证信息。

Composer服务库,包含服务和功能。该包会定期更新。

dev-main 2024-09-20 10:15 UTC

This package is auto-updated.

Last update: 2024-09-20 10:15:59 UTC


README

服务功能和工具的PHP库。参考URL:mejohLibrary

安装

您可以通过Composer安装mejohLibrary。在您的终端中运行以下命令

composer require mejoh/mejoh-library:dev-main

包参考

模块

使用/示例

use MejohLibrary\IpLocator;
use MejohLibrary\Math;
use MejohLibrary\Client;
use MejohLibrary\Currency;
use MejohLibrary\Validation;
use MejohLibrary\Hashing;
use MejohLibrary\Captcha;
use MejohLibrary\QRCode;

require 'vendor/autoload.php';

////IPLocator CLASS////
$ipaddress = '34.124.137.169';
$ipLocator = new IpLocator($ipaddress);

////MATH CLASS////
$math = new Math();
echo 'remainder - ' . $math->remainder(23,3);

////CLIENT CLASS////
$baseurl = 'https://www.xe.com/currencytables/';
$request_type = 'GET';
$header = [];
$body = [];
$client = new Client();
$request = $client->config($baseurl, $header)
            ->method($request_type)
            ->body($body)
            ->request();

////CURRENCY CLASS////
$apikey = 'API_KEY_HERE';
$currency = new Currency($apikey);

////Validation CLASS////
$validation = new Validation();
$pasw = $validation->generatePassword(30);

////HASHING CLASS////
$hashing = new Hashing();
$generate = $hashing->generate($code, $value);

////CAPTCHA CLASS////
$captcha = Captcha::create()
        ->setHeight(100)
        ->setWidth(100)
        ->setText('Your Text')
        ->setFontSize(20)
        ->generateBase64();

////CAPTCHA CLASS////
$qrcode = new QRCode();
$uri = $qrcode->generate()
->setData('Test')
->setBackgroundColor('#121112')
->setForegroundColor('#ed0eb9')
->buildUri();

作者