E
E
evgenin2019-01-09 00:04:46
Classmates
evgenin, 2019-01-09 00:04:46

How to write characters (&, *, ",; ) in json classmates?

$message = "* such text ** for example";

// 3. Запостим в группу
$attachment = '{
          "media": [
            {
              "type": "text",
              "text": "'.$message.'"
            },
            {
              "type": "photo",
              "list": [
                {
                  "id": "'.$token.'"
                }
              ]
            }
          ]
        }';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Moskus, 2019-01-09
@evgenin

The escaping rules for JSON are described exhaustively here: https://www.json.org/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question