Strong php code conversion function. This function is powerful. it is much more powerful than the built-in functions in php. This function can automatically obtain your character encoding and convert it to the encoding you want based on your reference, this function is more powerful than the built-in functions in php. This function can automatically obtain your character encoding, then convert the code you want based on your reference. if you need it, refer to it.
| The code is as follows: |
|
/**
* Implement transcoding in a loop
*
* @ Param string $ param (string, object, or array), $ currCharset current encoding, $ toCharset expected encoding
* @ Return parameter type
*/
Function zhandi_iconv ($ param, $ currCharset, $ toCharset ){
If ($ currCharset! = $ ToCharset ){
If (is_string ($ param )){
Return iconv ($ currCharset, $ toCharset, $ param );
}
Elseif (is_array ($ param )){
Foreach ($ param as $ key => $ value ){
$ Param [$ key] = zhandi_iconv ($ value );
}
Return $ param;
}
Elseif (is_object ($ param )){
Foreach ($ param as $ key => $ value ){
$ Param-> $ key = zhandi_iconv ($ value );
}
Return $ param;
}
Else {
Return $ param;
}
}
Return $ param;
} |
...