Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
function f($s){$l=strlenwhile(!$a&&++$i<strlen($s);while(!$a&&++$i<$l)for($j=0;$j<$l;)strpos($s,$b=substr$j=0;$b=substr($s,$j++$j++,$i);)strpos($s,$b)==strrpos($s,$b)&&($a[]=$b);return$a;}
function f($s){$l=strlen($s);while(!$a&&++$i<$l)for($j=0;$j<$l&&($j=0;$j<$l;)strpos($s,$b=substr($s,$j++$j++,$i))||1)&&(strpos($s,$b)==strrpos($s,$b)&&($a[]=$b)||1););return$a;}
function f($s){$l=strlen($s);while(!$a&&++$i<$l)for($j=0;$j<$l&&(($b=substr($s,$j++,$i))||1)&&(strpos($s,$b)==strrpos($s,$b)&&($a[]=$b)||1););return$a;}