奇淫巧技

  1. 处理html转义之后的图片路径问题
    $str = htmlspecialchars_decode($info['post_content']);
    $str = preg_replace('/()/i',"\${1}/upload/ueditor/\${3}",$str);

------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

get_defined_vars — 返回由所有已定义变量所组成的数组

array get_defined_vars ( void )


简单的查询返回自定义sql
$subQuery= Db('room_img')->alias('i')->field("if(id > 0 ,'1','0')")->where('i.room_id=a.id')->limit(1)->buildSql();
        $sc = " , $subQuery as img_num ";
img_num = 1 or 0