Found (1) results for "json_encode"

json_encode & JSON.parse

Sometimes, you will need to transform a php array into a json string in order to send it to a javascript code to work on it. In this case you will have to use the php built in function json_encode($phpArray) and then in javascript code, you have to transform this json string into an object so that you can iterate over it or do whatever you want with it, Now on javascript you can do this by using JSON.parse(allSearchableTags)