Page 1 of 1

How to EDIT the FILE

Posted: Sat Oct 13, 2007 1:01 am
by vinoth
Hi peoples!!

I have an array on one file based on the array I displays the values on drop down box,

Now the user wants to add the contents of drop down from browser.

So I Have to append the details with in the array, How can I achieve this?

Provide any suggestion or sample code..

Posted: Sat Oct 13, 2007 1:15 am
by feyd
Have you considered using a database (table) for this?

Posted: Sat Oct 13, 2007 1:24 am
by vinoth
No I didn't use any database for this..

Is it any possible way to read the file and insert the new Variable to the array..

Posted: Sat Oct 13, 2007 1:27 am
by feyd
Sure, it's possible, but why aren't you considering the use of a database for this?

Posted: Sat Oct 13, 2007 1:38 am
by vinoth
I already complete the project by using an array.
Now the client add new changes for this thats only I am plan to edit the file..

Please provide some instruction to achieve this

Posted: Sat Oct 13, 2007 7:37 am
by feyd
Using a database doesn't preclude you from using your existing code that works with arrays. It also doesn't preclude you from refactoring your code to be more flexible in the process.

var_export() can be used to great effect if you insist on using a file.