0

I have this PHP page :

enter image description here

For some reason I can't paste it here properly

I am able to write to file only in the last row, not all rows. As seen above I have tested using echo if I am displaying all content. I do, but for some reason can't write all of it to file.

5
  • 3
    You forgot to include your code in the question Commented Oct 11, 2016 at 10:07
  • included it as a screenshot now Commented Oct 11, 2016 at 10:11
  • Are you sure you have write permissions to /home? Commented Oct 11, 2016 at 10:13
  • yes, but it writes only the last row of the array Commented Oct 11, 2016 at 10:14
  • 1
    Don't include it as a image, include your code as text here in the question Commented Oct 11, 2016 at 10:14

1 Answer 1

1

function fopen() with w+ mode overrides the file because it places the file pointer at beginning of the file.

You want to use a mode instead.

See mode description: http://php.net/manual/en/function.fopen.php

Sign up to request clarification or add additional context in comments.

1 Comment

martin , how can i contact via skype or other messaging app, in case of other help needed :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.