PHP code example of 4927525 / hyperf-common

1. Go to this page and download the library: Download 4927525/hyperf-common 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/ */

    

4927525 / hyperf-common example snippets



// Request
var_dump(request()->path());
// redis
var_dump(redis()->keys('*'));
// ip
var_dump(get_client_ip());
// 控制台打印
p("我的p");
// 控制台日志打印
Logger()->error('ahahh');
// 验证ip
var_dump(verify_ip('127.0.0.1'));
// 生成随机uid
var_dump(uuid(32));
// 验证uri
var_dump(is_validURL('https://github.com/hyperf-plus/admin/blob/v2/composer.json'));