我的问题很简单:PHP strpos函数中针的长度是否有限制?
- 是否有限制到什么strpos针的长度可以吗?
- 如果是这样,有没有办法避开它?
看来我的长针不会触发某个位置,而我的长度较短的针可以。
例如:
if (strpos($data, "You were not able to complete this job. Please try again at a later date. Do not hit your back button.") !== false)
//solves as false
if (strpos($data, "You were not able") !== false)
//returns the position
请张贴演示该问题用例。 – nickb 2012-07-16 21:58:11
你能举个例子吗? – 2012-07-16 21:58:17
定义“长”针。多久了?似乎这里的问题可能与case或字符集相关,'strpos()'执行二进制比较,并不考虑这些。如果您通过的针头太长而无法应付,最可能的结果是内存不足或段错误。 – DaveRandom 2012-07-16 22:02:56