PHP code example of anerg2046 / helper

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

    

anerg2046 / helper example snippets


// 发起请求,get/post
Http::request($url, $data = null, $method = 'get', $params = null)

// get方式请求
Http::get($url, $data = null, $params = null)

// post方式请求
Http::post($url, $data = null, $params = null)

// post方式发送原始数据
Http::postRaw($url, $raw, $params = null)

// 带ssl证书请求原始数据
// $params数组必须包含cert_path,key_path,ca_path三个证书地址
Http::postRawSsl($url, $raw, $params)

//下载图片到指定位置
Http::saveImage($url, $path, $filename = null, $params = null)


// 加密字符串/数组
Encrypt::encrypt($data, $expire = 0, $key = '')

// 解密字符串
Encrypt::decrypt($data, $key = '')