Fast PHP format data format format

I have a PHP frontend and a C ++ backend, and I need to be able to send groups of names to the front end. What serialized format will be the most efficient / fastest for reading PHP?

Data examples

group1:
  name1 3923
  name2 9879
  name3 8944
group2:
  name5 9823
group3: 
  name9 9822
  name1 4894

What would be the fastest to read PHP?

  • XML
  • Json
  • Yaml
  • Protocol buffer
  • Comma / Space Limit our own system
  • Anything else? other?
+3
source share
4 answers

PHP , , . unserialize() - , PHP . PHP, , .

+6

PHP serialize() unserialize() , ( - , ). , , , PHP , , :

<?php
$groups = array('groups' => array( array('jeff' => 2343,
                                         'tom'  => 8477),
                                   array('baal' => 2873,
                                         'scorpio'  => 3210),
                                   array('jeff' => 2343,
                                         'tom'  => 8477)
                                 )
                            )
               );
?>

... unserializing , :

include 'groups.php';//makes $groups available

.

+2

JSON json_decode. , , , .

+1

, json_decode, . ++ ( json.org -):

++:

0

Source: https://habr.com/ru/post/1708386/


All Articles