- 主题:一个PHP的问题请教
if (empty($userInfo['car_type']) && $content !== '' && str_starts_with($content, '车型'))
这句里边,数据库里car_type默认值是null,测试时给content的内容是“车型黑色SUV”,为啥就进不到这个分支呢?
AI也说条件都满足了,但是实测无论如何都进不去哈,别的字段可以写进去数据库
求大佬们帮忙分析一下
--
FROM 106.38.48.*
几种可能,cartype是字符串null
content的字符编码不对
【 在 jansea (沧浪客) 的大作中提到: 】
: if (empty($userInfo['car_type']) && $content !== '' && str_starts_with($content, '车型'))
: 这句里边,数据库里car_type默认值是null,测试时给content的内容是“车型黑色SUV”,为啥就进不到这个分支呢?
: AI也说条件都满足了,但是实测无论如何都进不去哈,别的字段可以写进去数据库
: 求大佬们帮忙分析一下
--
FROM 123.121.208.*
var_dump 变量看看
【 在 jansea 的大作中提到: 】
: if (empty($userInfo\['car\_type'\]) && $content !== '' && str\_starts_with($content, '车型'))
: 这句里边,数据库里car_type默认值是null,测试时给content的内容是“车型黑色SUV”,为啥就
: ..................
发自「今日水木 on 2304FPN6DC」
--
FROM 183.241.167.*