Check if a string contains a palindromic sub | function to check if two consecutive same characters are present ; Driver Code
< ? php function check ( $ s ) { for ( $ i = 0 ; $ i < strlen ( $ s ) - 1 ; $ i ++ ) if ( $ s [ $ i ] == $ s [ $ i + 1 ] ) return true ; return false ; } $ s = " xzyyz " ; if ( check ( $ s ) ) echo " YES " , " STRNEWLINE " ; else echo " NO " , " STRNEWLINE " ; ? >