Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,036 questions

40,822 answers

573 users

How to decode a JSON string in PHP

2 Answers

0 votes
$json = '{"a":1,"b":2,"c":3}';

echo "<pre>";
var_dump(json_decode($json));
echo "</pre>";

/*
run: 

object(stdClass)#1 (3) {
  ["a"]=>
  int(1)
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
}

*/

 





answered Jul 2, 2016 by avibootz
0 votes
$json = '{"a":1,"b":2,"c":3}';

echo "<pre>";
var_dump(json_decode($json, true));
echo "</pre>";

/*
run: 

array(3) {
  ["a"]=>
  int(1)
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
}

*/

 





answered Jul 2, 2016 by avibootz

Related questions

1 answer 103 views
5 answers 150 views
3 answers 106 views
1 answer 125 views
1 answer 96 views
96 views asked Jul 16, 2016 by avibootz
...