SMR Posted September 2, 2007 Share Posted September 2, 2007 I'm kind of new to PHP and web-languages in general, so I need a teeny bit of help here! I need to know how to split all the lines in a multiline input box into an array. The text input box is called "userlist". How would I do this? Quote Link to comment https://forums.phpfreaks.com/topic/67680-solved-split-multi-line-text-box-into-array/ Share on other sites More sharing options...
Fadion Posted September 2, 2007 Share Posted September 2, 2007 <?php $text = $_POST['userlist']; $array = explode('\n', $text); ?> the idea is to get line breaks, but im not very sure it will work that way. Quote Link to comment https://forums.phpfreaks.com/topic/67680-solved-split-multi-line-text-box-into-array/#findComment-339981 Share on other sites More sharing options...
Hypnos Posted September 2, 2007 Share Posted September 2, 2007 <?php $text = $_POST['userlist']; $array = explode('\n', $text); ?> the idea is to get line breaks, but im not very sure it will work that way. It will. Quote Link to comment https://forums.phpfreaks.com/topic/67680-solved-split-multi-line-text-box-into-array/#findComment-339984 Share on other sites More sharing options...
SMR Posted September 2, 2007 Author Share Posted September 2, 2007 Thanks I'll try that out. Quote Link to comment https://forums.phpfreaks.com/topic/67680-solved-split-multi-line-text-box-into-array/#findComment-339987 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.