What would this PHP array look like in JavaScript?
What would be the closest translation?
$nursery_rhyme = array(“mary”, “had”, “a”, “little”, “lamb”);
What would this PHP array look like in JavaScript? What would be the closest translation?
|
|||||
|
As others mentioned, the curly/smart quotes are invalid. You can get the JavaScript representation of most simple PHP structures by running the data through json_encode():
|
|||
|
|
|||||||||
|
Closest JS translation:
Notice:
|
||||
|