首页
Python
Java
PHP
IOS
NodeJS
JavaScript
HTML5
小程序
AI
letterPositions
全部标签
php - 如何查找字符串中字符出现的数组
我正在PHP中搜索一个函数来返回字符串中字符位置的数组。输入这些参数“helloworld”,'o'将返回(4,7)。提前致谢。 最佳答案 不需要循环$str='HelloWorld';$letter='o';$letterPositions=array_keys(array_intersect(str_split($str),array($letter)));var_dump($letterPositions); 关于php-如何查找字符串中字符出现的数组,我们在StackOverfl
php
字符
section
数来
letterPositions
string
Home
Powered By IT.CAOLU.XIN
页面耗时:0.0584s