i'm working on an php-application, and now i have to build an interface to communicate between jquery and php. i already have a working controller/action. what is the best way to communicate with jQuery, if i need to send an array to php in the request.
example: data that is needed to fulfill the request:
$request_data = array
(
'key1' => 'value1',
'list1' => array
(
'listkey1' => 'listvalue1',
)
)
should i send this in different as "normal" post-request, or is it easier to send one post-var with the array encoded in json? ($post_json="{key: value....})
the focus is on easy integration in jquery
edit: it is not about passing the data to the client, it is about passing the array from the client to the php-script