matfish Posted October 20, 2006 Share Posted October 20, 2006 Hi, Iv got a list such as:Line 1Line 2Line 3which I wanted to copy & paste into a text box then put them into an array as separate results. Also then display each line with a comma to output:line 1, line 2, line 3,Any ideas? Wanted to output the above and also put in array so I can do other stuff like put certain keywords into a database.TIA Quote Link to comment Share on other sites More sharing options...
akitchin Posted October 20, 2006 Share Posted October 20, 2006 look up explode() and implode() in the manual. the former turns a string into an array based on whatever "splitting character" (called a delimiter) you want to stipulate, which in this case looks like it'd be a newline character "\n" (and/or carriage return, "\r"). implode() then does the opposite - glues together every value in an array with a certain character between each value, which in this case looks like it'd be ', '.post back if you run into troubles or are confused about their use. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.