brown2005 Posted November 26, 2006 Share Posted November 26, 2006 hi i have two text area'sa and bif in a isabcdand in b is1234i want to process them so they come out asa - 1b - 2c - 3d - 4ready to be put into mysql..any ideas please Link to comment https://forums.phpfreaks.com/topic/28523-echo-2-text-areas/ Share on other sites More sharing options...
trq Posted November 26, 2006 Share Posted November 26, 2006 Post your code! Link to comment https://forums.phpfreaks.com/topic/28523-echo-2-text-areas/#findComment-130516 Share on other sites More sharing options...
brown2005 Posted November 26, 2006 Author Share Posted November 26, 2006 what code? there is no code, thats wat i want help for, all i have is the form for posting the info, wat i want to know is how u take the results from the two textareas and make sure that they are separate records and put a with 1, b with 2, etc... etc...i know i will probably have to use explode() but how do i do it on both text areas and make them corresponde with each other Link to comment https://forums.phpfreaks.com/topic/28523-echo-2-text-areas/#findComment-130519 Share on other sites More sharing options...
trq Posted November 26, 2006 Share Posted November 26, 2006 Loop through the data in each textarea using explode on the newline "\n" char. Then use [url=http://php.net/array_combine]array_combine[/url] to create a new array of the keys / values. Then simply use a foreach loop to create the strings you need for your query. Link to comment https://forums.phpfreaks.com/topic/28523-echo-2-text-areas/#findComment-130524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.