可以用PHP里的strpos函数,这个函数可以实现你的要求,如:$str_add = \'中国人民银行\';
function fun($str1,$str2)
if(strpos($str1,$str2)!==-1) {
echo "true";
}
fun($str_add1,'银行');
这个函数就实现了你想要的功能了
唉,自己搞定了。function checkstr($str){ $needle = \"a\";//判断是否包含a这个字符 $tmparray = explode($needle,$str); if(count($tmparray)>1){ return true; } else{ return false; } } 到技术吧网站查看回答详情>>
[pre=brush:php;toolbar:false;]function fun($a, $b) {
if(strpos($a, $b) !== -1) {
return true;
}
else {
return false;
}
}[/pre]
[pre=brush:php;toolbar:false;]if($item['isBest'] != 1 || empty($item['ext_pack']['ent_special_type'])) continue;[/pre]
[pre=brush:delphi;toolbar:false;]program p1;
var a,b,sum:integer;
begin
write('Please input A:');
readln(a);
write('Please input B:');
readln(b);
sum:=a+b;
writeln('sum=',sum);
readln
end.[/pre]