PHP code example of yii-tool / helpers
1. Go to this page and download the library: Download yii-tool/helpers 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/ */
yii-tool / helpers example snippets
apacheconf
// 单例实例化
$client = \Yii\Helpers\make(\GuzzleHttp\Client::class);
// 单例实例化,带参数
$client = \Yii\Helpers\make(\GuzzleHttp\Client::class, ['base_uri' => 'http://baidu.com']);
// 读取配置文件
echo \Yii\Helpers\config('upload.url');
apacheconf
echo \Yii\Helpers\cnDate("2024-05-01 16:00:00");
apacheconf
echo \Yii\Helpers\floatRtrimZero('1.30000'); // 1.3