Skip to content

Instantly share code, notes, and snippets.

@koto
Created September 22, 2010 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koto/592387 to your computer and use it in GitHub Desktop.
Save koto/592387 to your computer and use it in GitHub Desktop.
<?php
// prepare options
$a = array(
'top 1' => array(
'sub 1' => 100,
'sub 2' => array('sub sub 1' => 101, 'sub sub 2' => 102),
),
'top 2' => 103
);
echo json_encode($a);
$.getJSON('ajax/arrays.php', function(data) {
$('input[name=demo]').optionTree(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment