$a='Would you like to have responses to your questions sent to you via email'
for($a as $b=>c){
}
请给我解决方案
$a='Would you like to have responses to your questions sent to you via email'
for($a as $b=>c){
}
请给我解决方案
<?php echo substr_count($a, 't'); ?>
这是一个解决方案,虽然不一定是最好的
$letterCount = array_count_values(
str_split(strtolower($a))
);
$tCount = (isset($letterCount['t'])) ? $letterCount['t'] : 0;
$count = preg_match_all('/t/', $str);
检查这个
<?php
$a = 'Would you like to have responses to your questions sent to you via email';
$t_explod = explode('t', strtolower($a));
echo count($t_explod) - 1;
?>