/**
* @param string $begin 开始字符串
* @param string $end 结束字符串
* @param string $str 需要截取的字符串
* @return string
*/
function get_str($begin,$end,$str){
$b = mb_strpos($str,$begin) + mb_strlen($begin);
$e = mb_strpos($str,$end) - $b;
return mb_substr($str,$b,$e);
}
function curlGet($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
return curl_exec($ch);
}
/**
* 定义分类树函数
* @param items 需要分类的二维数组
* @param $id 主键(唯一ID)
* @param $belong_id 关联主键的PID
* @son 可以自定义往里面插入就行
*/
function catagory($items,$id='id',$belong_id='belong_id',$son = 'children'){
$tree = array(); //格式化的树
$tmpMap = array(); //临时扁平数据
foreach ($items as $item) {
$tmpMap[$item[$id]] = $item;
}
foreach ($items as $item) {
if (isset($tmpMap[$item[$belong_id]])) {
$tmpMap[$item[$belong_id]][$son][] = &$tmpMap[$item[$id]];
} else {
$tree[] = &$tmpMap[$item[$id]];
}
}
unset($tmpMap);
return $tree;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有