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 692185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:37:29+00:00 2026-05-14T02:37:29+00:00

I am doing something like: $outputFile = getCurrentDBSnapshot($data); where $data is the resource stream

  • 0

I am doing something like:

$outputFile = getCurrentDBSnapshot($data);

where $data is the resource stream that am passing in, basically from command prompt am passing an file and am opening it using fopen for writing with ‘w+’ permissions, now getCurrentDBSnapshot would get the current state of a table and would update the $data csv file, so basically $outputFile would be updated with the current state of database table, now I want to var_dump or print the value of $outputFile to see the data present into it.

But when I do

$this->fout = fopen($outputFile,'r') or die('Cannot open file');
$test = fgetcsv($outputFile,5000,";");
var_dump($test);

It gives me an error saying that it expects parameter 1 to be a string type and am passing resource.

My goal to see the contains of $outputFile

and so my question is that

How can I see the contains present in $outputFile or how can I see what getcurrentDBSnapshot function is returning me ?

  • 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-05-14T02:37:29+00:00Added an answer on May 14, 2026 at 2:37 am

    fegtcsv takes as first parameter a file handle, not a filename. You’ll need to do something like:

    $this->fout = fopen($outputFile,'r') or die('Cannot open file');
    while ($test = fgetcsv($this->fout,5000,";"))
    {
        var_dump($test);
    }
    

    Note that fgetcsv merely gets a single line of the file, analogously to fgets.

    Also I’m not sure why you’re passing a semicolon as the third argument to fgetcsv. CSV stands for comma-separated-value; are you sure your file is semicolon-delimited?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Usually I was doing something like that (just a example): using (Stream xmlStream =
Doing something like this: from zipfile import ZipFile #open zip file zipfile = ZipFile('Photo.zip')
I'm doing something like zgrep somepattern access_log.X.gz But I find that a lot of
I am doing something like this in myproject.myapp.urls : from django.conf.urls.defaults import * urlpatterns
I am doing something like this in SP, insert into @FilteredTbl select * from
I'm doing something like this to get the tweets from a list in twitter:
When doing something like $output = shell_exec(command 2>&1); collecting the command's stdout & stderr
I have a query doing something like: SELECT FieldX, FieldY FROM A WHERE FieldW
When I am doing something like this: <propertyregex input=${escaped.std} regexp=.*[/\\]data[/\\](.*) select=\1 property=relative.std/> where escaped.std
There's a text file that I'm reading line by line. It looks something like

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.