Queries for characters in a repeated string | Print whether index i and j have same element or not . ; Finding relative position of index i , j . ; Checking is element are same at index i , j . ; Driver Code
< ? php function query ( $ s , $ i , $ j ) { $ n = strlen ( $ s ) ; $ i %= $ n ; $ j %= $ n ; if ( ( $ s [ $ i ] == $ s [ $ j ] ) ) echo " Yes STRNEWLINE " ; else echo " No " ; } $ X = " geeksforgeeks " ; query ( $ X , 0 , 8 ) ; query ( $ X , 8 , 13 ) ; query ( $ X , 6 , 15 ) ; ? >