How To Convert Php Array To Javascript Array Creativedev

Convert Php Array Into Javascript Json Array In ajax, we pass php data into ajax request and multiple data generate as response which is in array but array format of php and javascript are different. so, today i am going to explain how you pass php data and convert into a javascript array. so, let’s understand code: $new arr. = '"'.$key.'":"'.$value.'",';. Php provides a function to convert php arrays into javascript code: json encode(). (technically, it's json format; json stands for javascript object notation) use it like this:
Sign in