Skip to content
Advertisement

How to add double quote to array values php [closed]

I have an array like below format:

JavaScript

But I want to convert the array so it would look like below format

JavaScript

I have already tried lots of things about this issue but can’t get the desire solution yet.

Anybody help please ?

Advertisement

Answer

If you really need to wrap array values in double quotes, here is a simple method with array_map():

JavaScript

Output will be:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement