Answer the question
In order to leave comments, you need to log in
How to convert two dimensional JSON array to string?
There was a problem converting a two-dimensional array to a string (JSON).
An empty value is output without any error.
<?php
$arr = array(
array(
'type' => 0,
'text' => '1 блок'
),
array(
'type' => 0,
'text' => '2 блок'
),
array(
'type' => 0,
'text' => '3 блок'
)
);
echo json_encode($arr);
?>
Answer the question
In order to leave comments, you need to log in
copied your code and ran - writecodeonline.com/php
returned
[{"type":0,"text":"1 \u0431\u043b\u043e\u043a"},{"type":0,"text":"2 \u0431\u043b\u043e\u043a"},{"type":0,"text":"3 \u0431\u043b\u043e\u043a"}]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question