I have the following array:
Array
(
[BookDateID] => 4
[HotelName] => Adams’ Inn
)
Output:
{"BookDateID":"4","HotelName":null}
Any magic?
BTW, I have an alternative solution by looping thru each array and have them mb_convert_encoding(str,'HTML-ENTITIES') but I want the character remains the same as I have to insert this into a DB.
foreach($array as $key=>$value){
$array[$key] = mb_convert_encoding($value,'HTML-ENTITIES');
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…