![]() |
Fseek Function not working !!!!
Code:
<?phpIts output is as follows: Code:
<image></image>Data WrittenCode:
<image>Data Written</image> |
Re: Fseek Function not working !!!!
Just try the following.
Close the file after writing string and then open back to write and see what is the output? |
Re: Fseek Function not working !!!!
Quote:
More over, whenever I re-run the PHP page, it should return the current pointer position which should be the at the end here. But ftell function returns 0 everytime, whether text file has data or not. |
Re: Fseek Function not working !!!!
When you open the file in append mode it always writes to the end of the file and not where the FILE_POINTER
|
Re: Fseek Function not working !!!!
Quote:
|
Re: Fseek Function not working !!!!
Probably what I can get is the file is opened and 0 is set at the last or something like that so that you can not do anything to the previous data.
|
Re: Fseek Function not working !!!!
Quote:
|
Re: Fseek Function not working !!!!
Probably r+
|
Re: Fseek Function not working !!!!
Quote:
Code:
<?phpnow the result is as follows: Code:
<image>Data Written |
Re: Fseek Function not working !!!!
PHP does not have a function to insert text into the middle of a file and you have to read the complete data and then insert the data in the variables and write it back. Thats the best way to go about getting this done.
|
| All times are GMT +5.5. The time now is 11:00. |