ajax - return multiple json encoded array from the server -



ajax - return multiple json encoded array from the server -

i want know how can homecoming multiple encoded json array server

ex.

//client

$.ajax({ url: 'items-details.php', type: 'post', data: {member_id: 1}, datatype: 'html', success: function(responsetext) { } });

//server, items-details.php

//some code here

then, final output ex. itemsdata array , itemscategories array, utilize json_encode() on both array. how can homecoming both arrays client? know how handle echo() - treated client string

before, utilize

echo(json_encode(itemsdata));

then client parse .. how can homecoming multiple json encoded array: itemsdata , itemscategories

for example, create let's $response array, contain both $itemsdata , $itemscategories arrays.

// $itemsdata , $itemscategories defined here $response = array( $itemsdata, $itemscategories ); homecoming json_encode($response);

ajax json

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -