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,037 questions

40,788 answers

573 users

How to encode JSON from array with ordered indexes in PHP

1 Answer

0 votes
$json = json_encode([0 => 'php', 2 => 'java', 3 => 'python']);
var_dump($json);
 

/*
run:

string(35) "{"0":"php","2":"java","3":"python"}"

*/

 





answered Jul 24, 2018 by avibootz

Related questions

1 answer 96 views
2 answers 96 views
1 answer 89 views
1 answer 92 views
...