gpt4 book ai didi

PHP 正斜杠匹配

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

我如何在 PHP 中检查某些字符串是否包含正斜杠?

最佳答案

使用 strpos() 检查事件

if (strpos($string, '/') !== FALSE) // Found

Returns the position as an integer. If needle is not found, strpos() will return boolean FALSE.

这比正则表达式和大多数其他方法更快,因为它会在第一次出现时停止检查。

关于PHP 正斜杠匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6183747/

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