I'm writing a PHP CLI-Application; in my application I want to handle some array-to-json-operations.
Let's use an example:
$test = array( 'bla' => 'äöü' );
$test['bla'] = htmlentities( $test['bla'] );
echo json_encode( $test );
The output is the following:
{"bla":"äöü"}
If I use this to handle my array
function encode_items(&$item, $key)
{
$item = utf8_encode($item);
}
array_walk_recursive($rows, 'encode_items');
I'm getting stuff like that:
2\u20ac
What can I do here? I read some stuff about changing the php.ini - do I really have to do that or can I do something in my code to get the stuff working?
Thank you very much :-)