PHP编码问题的解决方案
首先了解几个函数:
- urldecode:解码已编码的
url
字符串 - urlencode: 编码
URL
字符串 - base64_encode:使用 MIME base64 对数据进行编码
- base64_decode:对使用 MIME base64 编码的数据进行解码
- unpack 解包函数
thinkphp的一些有用的函数
OR 和 and 的并列
Db::name("user_open_card")->where("status", 2)
->whereOr(function ($q) {
$q->where("status", 1)
->where("open_card_type", 2);
})->select();
echo Db::name("user_open_card")->getLastSql();
SELECT * FROM `yoshop_user_open_card` WHERE `status` = 2 OR ( `status` = 1 AND `open_card_type` = 2 )