I am getting ajax response in array format from php url. How to extract array response values in jQuery? FYI:
PHP dizidir:
$response = array('msg' => 'Hello', 'html' => '<b>Good bye</b>');
Benim ajax cevaben $ yanıtı dizi alıyorum. yani
var promo = "promo=45fdf4684sfd";
$.ajax({
type: "POST",
url: baseJsUrl + "/users/calc_discount",
data: promo,
success: function (msg) { // I am getting $response here as ajax response.
//alert(msg);
// Here I want to check whether response is in array format or not. if it is in array format, I want to extract msg here and want to use response array values.
}
});
Let me know answer pls. Thanks.