1. Go to this page and download the library: Download jiosen/lib 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/ */
jiosen / lib example snippets
composer
use Jiosen\Lib\Captcha;
use Jiosen\Lib\Cache;
use Jiosen\Lib\Db;
use Jiosen\Lib\Http;
use Jiosen\Lib\Request;
use Jiosen\Lib\Upload;
use Jiosen\Lib\Validate;
//验证码
$captcha = new Captcha();
$captcha->show($id);
//缓存
$cahce = Cache(dirname(__FILE__) . '/cache/');
dump($cache->set('name111',['s'=>11]));
dump($cache->get('name'));
dump(cache()->set('age',10));
//数据库
$mod = new Db(['dbname'=>'jtest','prefix'=>'j_']);
dump($mod->name('tablename')->find());
dump($mod->table('tablename')->order('id desc')->limit(10)->select());
//上传文件
try {
$files = Upload::file(dirname(__FILE__) . '/cache/file','music,file',['fileExt'=>'txt,mp3,webp']);
dump($files);
} catch (\Exception $e) {
echo $e->getMessage();
}
//请求
dump(Request::getInstance()->param(),Request::getInstance()->isMobile());
dump(request()->param('id',0,'intval'));
//验证
dump(Validate::ip('127.0.0.1','ipv6'),Validate::ip('127.0.0.1'));
dump(Validate::email('[email protected]'));
更多例子看 test/index.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.