Function that return true if sub is a sub - sequence in s
< ? php function checkSub ( $ sub , $ s ) { $ j = 0 ; for ( $ i = 0 ; $ i < strlen ( $ s ) ; $ i ++ ) if ( $ sub [ $ j ] == $ s [ $ i ] ) $ j ++ ; return $ j == strlen ( $ sub ) ; }