PHP array character set encoding and conversion functions
- /**
- * Array to encoding
- * @ Param array $ array the array to be transcoded
- * @ Param String $ inCharset original encoding
- * @ Param String $ encoding after outCharset conversion
- * @ Return $ array the converted array
- * @ Site: bbs.it-home.org
- */
- Private function arrayCoding ($ array, $ inCharset, $ outCharset ){
- If (! Is_array ($ array ))
- Return false;
- Foreach ($ array as $ key =>&$ value ){
- If (is_array ($ value )){
- $ Value = $ this-> arrayCoding ($ value, $ inCharset, $ outCharset );
- } Else {
- $ Value = iconv ($ inCharset, $ outCharset, $ value );
- }
- }
- Return $ array;
- }
-
>>> For more articles on php array encoding conversion, see php encoding conversion functions (automatic conversion character set supports array conversion) examples of php object conversion arrays and array conversion objects (text) php code for automatic content encoding and conversion php array encoding conversion method for reference to learning php string encoding conversion and judgment |