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? 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. 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. 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. 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
Archived
This topic is now archived and is closed to further replies.