首页 > 解决方案 > TYPO3 内容元素:PHP 警告:strlen() 期望参数 1 为字符串,给定数组

问题描述

我不断收到这个错误,我不知道如何解决它。我已经搜索过,但没有一个答案真的对我有帮助。

我从这段代码开始:

$child3 !== null && strlen($child3) > 0 ? array_push($children, (int)$child3) : null;

对此代码:

is_array($child3) && count($child3) > 0 ? array_push($children, (int)$child3) : null;

问题仍然存在,我不确定如何解决。

我想我仍然需要检查其他东西,但我不确定是什么。

标签: php

解决方案


推荐阅读