Changeset 6111 for trunk/prototype/request.php
- Timestamp:
- 05/04/12 18:38:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/request.php
r5399 r6111 29 29 30 30 ///Conversor Para utf8 ante de codificar para json pois o json so funciona com utf8 31 function srtToUtf8($data)32 {33 return mb_convert_encoding( $data , 'UTF-8' , 'UTF-8 , ISO-8859-1' );34 }35 36 31 function toUtf8($data) 37 32 { 38 if(is_array($data)) 39 { 40 $return = array(); 41 foreach ($data as $i => $v) 42 $return[srtToUtf8($i)] = (is_array($v)) ? toUtf8($v) : srtToUtf8($v); 43 44 return $return; 45 } 46 else 47 return srtToUtf8($data); 33 if(!is_array($data)) 34 return mb_convert_encoding( $data , 'UTF-8' , 'UTF-8 , ISO-8859-1' ); 35 36 $return = array(); 37 38 foreach ($data as $i => $v) 39 $return[toUtf8($i)] = toUtf8($v); 40 41 return $return; 48 42 } 49 43 ////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.