[Extern file]
Yeah, again.
I'm trying to modifie a extern file created by me. I used fopen to open the file, fprintf to wrote in the file and then i used fclose to close the file. But my questin is, how to delete a part of the file? :/ |
Re: [Extern file]
Something like:
PHP Code:
|
Re: [Extern file]
If i want to delete the var "name" i must to put something like this:
PHP Code:
|
Re: [Extern file]
No, that wouldn't work. First you can't format like that inside of the native. That native actually replaces the line you specify, and when you set the replacing string to "", the line is obviously emptyed. Somehow if you want to delete/change some specific string istead of some line, you should read the file, then delete everything you want and after that write it back to the file.
|
Re: [Extern file]
But if i want to delete "pedrito" i have to put this:
PHP Code:
How must to put a string to delete it? </span></span> |
Re: [Extern file]
I don't really understand you, but I already said that that doesn't work at all. What I were trying to say was that write_file replaces the line you specify with the text you pass.
|
Re: [Extern file]
But how can i specify the line?
In the "" i must write the text that i want to replace or the text that i put in replace of the other? I don't understand.. if you can put an example it would better. EX: If i wan't to delete "pedrito" how can i put? And then, if i want to delete the variable "name".. =(! |
Re: [Extern file]
To empty a specific line, use stock:
PHP Code:
1. Read the file to memory. 2. Empty things you want. Natives for that exist already. 3. Write the modified text to the file. |
Re: [Extern file]
AAAAAAAAAAAAAAA i don't understand!.
I'm stupid sorry, jajaja,. Look, i have to delete the word "pedro". I have to put: PHP Code:
Or PHP Code:
And if i have to delete the var "name" how i have to put? |
Re: [Extern file]
I don't know about reading files, write files, etc... but, no... that is wrong...
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 15:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.