【发布时间】:2022-11-10 18:50:45
【问题描述】:
如何输出有关 var_dump 中值 (1) 的信息,
在str_contains 中指定搜索什么?
$a = 1;
$b = str_contains($a, 1); //value 1 for which to show information in var_dump
echo var_dump($b); // prints bool(true) and not information about the value 1,
// which is specified in the search
【问题讨论】:
-
尝试过阅读文档,或者您更喜欢编写没有理解的随机代码并希望它会按照您的喜好工作?
-
您想要/需要返回哪些信息? str_contains ... "如果 needle 在 haystack 中,则返回 true,否则返回 false。" 如果您需要返回不同的信息,您仍然可以编写自己的函数,使用
str_contains
标签: php