PHP code example of mpcn / tp-helper

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

    

mpcn / tp-helper example snippets


//去除字符串中所有 HTML 代码
StringHelper::strip_html_tags($string);

//同时支持 UTF-8、GB2312 汉字截取
ArrayHelper::str_cut($string, $str_len, $start = 0, $code = 'UTF-8');

//计算 UTF-8 字符串长度
ArrayHelper::strlen_utf8($string);

//获取指定长度的随机字母数字组合的字符串
ArrayHelper::random($length = 5, $type = 0);

//二维数组按某个键值进行排序
ArrayHelper::array_sort($array, $keys, $order);