当前位置: 移动技术网 > IT编程>开发语言>PHP > php分页查询mysql结果的base64处理方法示例

php分页查询mysql结果的base64处理方法示例

2017年12月12日  | 移动技术网IT编程  | 我要评论

本文实例讲述了php分页查询mysql结果的base64处理方法。分享给大家供大家参考,具体如下:

public function public_about(){
   $sql= "selectc.catid,c.catname,c.catdir,from_base64(p.content) from v9_page p joinv9_category c on c.catid=p.catid where c.parentdir = 'jmwm/'";
   if(isset($_request['biaoshi'])){
     $sql= "selectc.catid,c.catname,c.catdir,p.content from v9_page p join v9_category c onc.catid=p.catid where c.catdir like '{$_request['biaoshi']}%'";
   }
   $mydb= pc_base::load_model('mymodel');
   $mpages= $mydb->query_listinfo($sql);
   $this->array_to_base64($mpages);
  // $article['content']=base64_encode(toutf8($article['content']));
   $msg= array();
   $msg['returncode']= "0";
   $msg['msg']= togbk("关于联系");
   $msg['comment']= $mpages;
   echo jsonformat($msg);
// return_msg(0,"关于联系",$mpages);
}
public function array_to_base64(&$array){
  foreach($array as $key => $value) {
    if(is_array($value)) {
      $this->array_to_base64($array[$key]);
    } elseif($key=="content"){
      $array[$key]=base64_encode(toutf8($value));
    }else{
      $array[$key]=togbk($value);
    }
  }
}

ps:这里再为大家提供几款比较实用的base64在线编码解码工具供大家使用:

base64编码解码工具:

在线图片转换base64工具:

base64在线编码解码 utf-8版:

base64在线编码解码 gb2312版:

更多关于php相关内容感兴趣的读者可查看本站专题:《php+mysql数据库操作入门教程》、《php+mysqli数据库程序设计技巧总结》、《php面向对象程序设计入门教程》、《php数组(array)操作技巧大全》、《php字符串(string)用法总结》、《php网络编程技巧总结》及《php常见数据库操作技巧汇总

希望本文所述对大家php程序设计有所帮助。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网