Reputation: 31
Thats my result when i say echo json_encode($array)
:
[{"name":"test"}]
I'm searching for something like replace. have php a method for replacing strings
in arrays
? The result should be this:
[{name:test}]
Upvotes: 1
Views: 3420
Reputation: 4739
You can do something like this:
<?php
$arr1 = array();
$i = 1;
function replace($key)
{
echo str_replace('"', '', $key)."<br />\n";
}
$fruits = array("d" => '"lemon', "a" => '"orange', "b" => "banana", "c" => "apple");
array_walk($fruits, 'replace');
?>
Upvotes: 1