Reputation: 79
How can I add double quote to this string. The string I have
01-08-2022,02-08-2022,04-08-2022,05-08-2022,06-08-2022,14-08-2022
The string I want
"01-08-2022","02-08-2022","04-08-2022","05-08-2022","06-08-2022","14-08-2022"
Upvotes: -1
Views: 257
Reputation: 7703
As an alternative to CBroe's solution in the comment, you can also work with str_replace:
$str = '01-08-2022,02-08-2022,04-08-2022,05-08-2022,06-08-2022,14-08-2022';
$str = '"'.str_replace(',','","',$str).'"';
echo $str;
//"01-08-2022","02-08-2022","04-08-2022","05-08-2022","06-08-2022","14-08-2022"
Upvotes: 0