PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
vinoth
Forum Contributor
Posts: 113 Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:
Post
by vinoth » Sat Oct 13, 2007 1:01 am
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..
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Oct 13, 2007 1:15 am
Have you considered using a database (table) for this?
vinoth
Forum Contributor
Posts: 113 Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:
Post
by vinoth » Sat Oct 13, 2007 1:24 am
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..
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Oct 13, 2007 1:27 am
Sure, it's possible, but why aren't you considering the use of a database for this?
vinoth
Forum Contributor
Posts: 113 Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:
Post
by vinoth » Sat Oct 13, 2007 1:38 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Oct 13, 2007 7:37 am
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.