HTML:
<input name="id" value="id" id="id">
<input name="where[abc]" value="abc">
<input name="where[xyz]" value="xyz">
<input name="something_else" value="i do not want this be included on submit">
<input type="submit" id="go">
JS
$(document).on("click", "#go", function(){
var data = $('input[name^="where["').serialize();
$.post("url.php", {id:$('#id').val(), where: data}, function(data){ ... })
});
How to pass the dynamic where[key] = value to url.php, so that on url.php:
print_r($_POST['where']) will show:
[abc => abc, xyz => xyz]
Need $_POST[where] as array or json also happy.
It is currently showing as an string and i need to use parse_str($_POST['where'], $where) which looks like not the best way