gpt4 book ai didi

php - 在空内部使用修剪

转载 作者:行者123 更新时间:2023-12-02 03:52:12 25 4
gpt4 key购买 nike

如何在empty()中使用PHP的trim()?

我尝试过:

empty(trim($myString));

最后说:

Fatal error: Can't use function return value in write context in......

我在某处读到这是不可能的,仍在寻找其他方法。

最佳答案

如果您的 PHP 版本早于 5.5,这不是问题,而是语言的限制。

Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.

empty();

关于php - 在空内部使用修剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34087493/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com