PHP code example of dongyao8 / commuse

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

    

dongyao8 / commuse example snippets


    
    ao8\Commuse\Character\Moneyts;


    $ip = new Moneyts;
    echo $ip->rmb('156.33');

    
    ao8\Commuse\Crypto\Aes;
      
    $str = '这个工具很好用';
    $aes = new Aes('12345678');
    // 加密
    $encrypted = $aes->encrypt($str);
    echo '要加密的字符串:'.$str.'<br>加密后的字符串:', $encrypted, '<hr>';
    // 解密
    $decrypted = $aes->decrypt($encrypted);
    echo '要解密的字符串:', $encrypted, '<br>解密后的字符串:', $decrypted;