欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP最长单一子串

程序员文章站 2022-04-08 20:03:03
...
$s='abcccddddddcdefg';
$max='';
while($s!=''){
    $i=0; 
    while($i$s) && $s[$i]==$s[0]) $i++;
    if ($i>strlen($max)){
        $max=substr($s,0,$i);
    }                       
    $s=substr($s,$i);
}
echo$max;
?>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了PHP最长单一子串,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。