how can make use response of multidimentional array in ajax that response in php but use in javascript -
this response of ajax
array ( [0] => array ( [name] => shoaib [description] => shoaib frontend developer ) [1] => array ( [name] => jawad [description] => jawad teacher ) )
above shown in console.log()
how can handle in javascript
to use response ( multi-dimensional array ) php script in javascript use json_encode
$arr=array(); $arr[]=array('name'=>'shaoaib'); $json=json_encode( $arr ); header('content-type: application/json' ); echo $json;
Comments
Post a Comment