我总是想知道为什么在PHP数组函数$needle之前我们有$haystack字符串函数,反之亦然.例如:
mixed array_search ( mixed $needle , array $haystack [, bool $strict = false ] )
bool in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] )
string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] )
int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )
Run Code Online (Sandbox Code Playgroud)
这是另一个PHP悲伤还是有某种逻辑解释?事情是我经常不记得哪一个是以什么顺序 - 也许超出这个的逻辑将有所帮助.
| 归档时间: |
|
| 查看次数: |
218 次 |
| 最近记录: |