/    Sign up×
Community /Pin to ProfileBookmark

writing to csv using fputcsv

I am trying to write a array of strings into the csv file using fputcsv. Some string consists of backslashes and double quote within them. for example
“hello world””,”program”,123,45. When write this string into a a csv file the output that I get is;
hello world”program”,123,45.
expected output:
hello world”,program,123,45.

I also tried to escape the backslash and the double quote. but still I am not getting the expected output.Could anyone please help me out with this problem.

Thanks in advance.

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @kl1980 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...