Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #19358

Re: Replace punctuation in an associative array

From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: Replace punctuation in an associative array
Date 2023-03-02 14:23 +0100
Message-ID <k6bmapFcv37U1@mid.individual.net> (permalink)
References <ttq5np$i9r$50@gallifrey.nk.ca>

Show all headers | View raw


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);


Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-02 12:44 +0000
  Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-02 14:23 +0100
    Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-03 01:03 +0000
      Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-03 10:36 +0100
    Re: Replace punctuation in an associative array Ezimene nimi Teine nimi <techfan55555@hotmail.com> - 2023-03-08 09:22 -0800
      Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-09 01:24 +0000
  Re: Replace punctuation in an associative array Arno Welzel <usenet@arnowelzel.de> - 2023-03-03 08:14 +0100
    Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-04 05:19 +0000
      Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-04 11:07 +0100
      Re: Replace punctuation in an associative array Arno Welzel <usenet@arnowelzel.de> - 2023-03-04 14:42 +0100
        Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-04 14:57 +0000
          Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-04 16:38 +0100
            Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-05 00:41 +0100
              Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-04 23:58 +0000
                Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-05 01:39 +0100
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-03-05 00:52 +0000
                Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-05 12:16 +0100
                Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-05 14:08 +0000
                Re: Bureaucracy (Was: Replace punctuation in an associative array) "J.O. Aho" <user@example.net> - 2023-03-06 09:30 +0100
                Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-07 16:43 +0000
                Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-03-07 18:56 +0100
                Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-07 22:53 +0000
                Re: Replace punctuation in an associative array Arno Welzel <usenet@arnowelzel.de> - 2023-03-08 23:44 +0100
                Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-09 01:25 +0000
                Re: Replace punctuation in an associative array Arno Welzel <usenet@arnowelzel.de> - 2023-03-10 09:08 +0100
                Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-10 15:20 +0000
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-01 14:08 +0000
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-06 00:26 +0000
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-12 22:45 +0000
                Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-04-13 07:41 +0200
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-13 11:50 +0000
                Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-04-13 14:26 +0200
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-13 22:37 +0000
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-14 01:12 +0000
                Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-04-14 19:34 +0200
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-14 22:21 +0000
                Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-16 12:40 +0000
                Re: Replace punctuation in an associative array "J.O. Aho" <user@example.net> - 2023-04-16 22:03 +0200
  Re: Replace punctuation in an associative array Ezimene nimi Teine nimi <yyyyyeeeee00000@writeme.com> - 2023-03-06 03:23 -0800
    Re: Replace punctuation in an associative array The Doctor <doctor@doctor.nl2k.ab.ca> - 2023-03-06 16:21 +0000
  Re: Replace punctuation in an associative array V <vvvvvvvvvvvvvvvvvvvv11111@mail.ee> - 2023-04-03 06:55 -0700
    Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-03 14:18 +0000
  Re: Replace punctuation in an associative array Angel <heyeeeeeeeeeeeeeeeeeee@gmail.com> - 2023-04-15 05:33 -0700
    Re: Replace punctuation in an associative array doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-04-15 13:52 +0000

csiph-web