PHP interview question exam 034. what tools are used for version control? SVN5, how to implement string flip? $ StrHolleWorld !; Echostrrev ($ str );! DlroWelloHechot_strrev ($ str );! DlroWelloHfunctiont_strrev ($ str) {$ n_str PHP interview question exam 03
4. what tools are used for version control?
SVN
5. how to implement string flip?
$ Str = "Holle World! "; Echo strrev ($ str );//! DlroW elloHecho t_strrev ($ str );//! DlroW elloHfunction t_strrev ($ str) {$ n_str = ''; for ($ I = strlen ($ str); $ I >=0; $ I --) {$ n_str. = $ str [$ I];} return $ n_str;} // end func
This is okay, but it should not.
Solution to Chinese garbled text:
/*** Reverse the utf8 string and use the function starting with mb * @ param string $ str * @ return string */function t_strrev ($ str) {$ len = mb_strlen ($ str, 'utf-8'); $ string = ''; for ($ I = $ len-1; $ I> = 0; $ I --) {$ string. = mb_substr ($ str, $ I, 1, 'utf-8');} return $ string;} // end func