Re: Replace punctuation in an associative array
"J.O. Aho" <[email protected]> Thu, 2 Mar 2023 14:23:37 +0100
| Newsgroups | comp.lang.php |
|---|---|
| Message-ID | <[email protected]> |
On 3/2/23 13:44, The Doctor wrote:
A wild guess, this still to do with your json, which you have asked help
with quite often.
> I wish to replace [[ with [
>
> AND
>
> ]] with ] in an associative array .
Don't store objects as an array and place those arrays in an array.
Create an object and place the object into the array which is part of
your main-object.
> How can I do this?
If you just look at a string, string replace could work quite well to do
this
str_replace('[[','[',$str);