Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:14:28+00:00 2026-06-07T20:14:28+00:00

Avoid default quotes from csv using fputcsv fputcsv($fp, $array, ‘,’, ”); // OR fputcsv($fp,

  • 0

Avoid default quotes from csv using fputcsv

fputcsv($fp, $array, ',', '"'); // OR fputcsv($fp, $array);

In test.csv

testname,045645765789,"""04.07.2012 12:10:52"""

How to avoid above quotes here?

Like below

testname,045645765789,04.07.2012 12:10:52
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:14:30+00:00Added an answer on June 7, 2026 at 8:14 pm

    Two double-quotes are used to escape double-quotes, so it looks like your date/time is already quoted. If you just want to get a correctly quoted CSV, you could try removing any existing double-quotes (this might be a bit brute force):

    $array = array('testname',045645765789,'"04.07.2012 12:10:52"');
    $array = str_replace('"', '', $array);
    
    fputcsv($fp, $array);
    
    // Output: testname,79323055,"04.07.2012 12:10:52"
    

    The fputcsv wants to put something around a string with a space in it, so if you want no quotes at all you’ll either need to work around or make your own function to do what you want. There are lots of good solutions under this question (edit: this was a different link). Alternately there are a number of other solutions in the comments of the PHP manual.

    Based on the first link, you could do:

    $array = array('testname',045645765789,'"04.07.2012 12:10:52"');
    $array = str_replace('"', '', $array);
    
    fputs($fp, implode(',', $array)."\n");
    
    // Output: testname,79323055,04.07.2012 12:10:52 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I avoid NullPointerExceptions ? I have tried using try-catch blocks but that
Also trying to avoid any use of plugins, (apart from jQuery of course, whether
When adding items using the default insert method Insert(key, value) and as such using
Can I avoid using MS AJAX completely while developing ASP.NET Webforms applications and use
I have heard that we should avoid Default ASP.Net Controls, because they are heavy
I'm trying to avoid the default Silverlight loading screen displaying before my applet and
I want to get the default timezone (PST) of my system from Python. What's
In order to avoid Java exceptions I'm using Scala's exception handling class. However, when
I try to avoid using static classes in my production code as they cant
Is there any way to avoid this kind of code when overwriting the default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.