fork(1) download
  1. <?php
  2.  
  3. $options = [];
  4.  
  5. $options['hide_users'] = 'yes';
  6.  
  7. $options['hide_tasks'] = 'no';
  8.  
  9. $options['sort_table1_by'] = 'name';
  10. $options['sort_table1_how'] = 'asc';
  11.  
  12. $options['sort_table2_by'] = 'tasks';
  13. $options['sort_table2_how'] = 'desc';
  14.  
  15. $options['sort_table3_by'] = 'event';
  16. $options['sort_table3_how'] = 'desc';
  17.  
  18. $options['sort_table4_by'] = 'blabla';
  19. $options['sort_table4_how'] = 'desc';
  20.  
  21. $options['some_stuff_name'] = 'some_stuff_value';
  22.  
  23.  
  24. var_dump($options);
  25.  
  26.  
  27. $cookie = serialize($options);
  28.  
  29. var_dump($cookie);
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
array(11) {
  ["hide_users"]=>
  string(3) "yes"
  ["hide_tasks"]=>
  string(2) "no"
  ["sort_table1_by"]=>
  string(4) "name"
  ["sort_table1_how"]=>
  string(3) "asc"
  ["sort_table2_by"]=>
  string(5) "tasks"
  ["sort_table2_how"]=>
  string(4) "desc"
  ["sort_table3_by"]=>
  string(5) "event"
  ["sort_table3_how"]=>
  string(4) "desc"
  ["sort_table4_by"]=>
  string(6) "blabla"
  ["sort_table4_how"]=>
  string(4) "desc"
  ["some_stuff_name"]=>
  string(16) "some_stuff_value"
}
string(380) "a:11:{s:10:"hide_users";s:3:"yes";s:10:"hide_tasks";s:2:"no";s:14:"sort_table1_by";s:4:"name";s:15:"sort_table1_how";s:3:"asc";s:14:"sort_table2_by";s:5:"tasks";s:15:"sort_table2_how";s:4:"desc";s:14:"sort_table3_by";s:5:"event";s:15:"sort_table3_how";s:4:"desc";s:14:"sort_table4_by";s:6:"blabla";s:15:"sort_table4_how";s:4:"desc";s:15:"some_stuff_name";s:16:"some_stuff_value";}"