[SOLVED] Textarea To Array

12-23-08, 07:58 PM
|
 |
Wannabe Coder
|
|
Join Date: Aug 2008
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
[SOLVED] Textarea To Array
How would I seperate line by line in a textarea into an array?
I would assume the explode() function but I dont know how to go about it.
|

12-23-08, 08:54 PM
|
 |
Code Master
|
|
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Last edited by DAL; 12-23-08 at 08:55 PM.
Reason: Seriously Im getting worse with this - I keep making stupid mistakes, all work and no play I think :)
|

12-23-08, 09:33 PM
|
 |
Wannabe Coder
|
|
Join Date: Aug 2008
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Great thank you 
|

12-23-08, 09:34 PM
|
 |
Code Master
|
|
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Cool - remember to mark your thread solved
Cheers
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
|

12-24-08, 03:09 AM
|
 |
Community Leader
|
|
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
|
|
I'd remove the return carriage (\r) from the explode(), 'cause it's not always present. I'd just explode on the \n and then (if you want) trim() each line to remove the possible return carriage character.
|

12-26-08, 11:04 AM
|
 |
Wannabe Coder
|
|
Join Date: Aug 2008
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Nico. That fixed a small bug 
|

12-26-08, 05:40 PM
|
 |
Wannabe Coder
|
|
Join Date: Aug 2008
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This works when I just echo the array but when I try to add something else it doesnt work.
Any ideas?
|

12-26-08, 06:01 PM
|
 |
Code Master
|
|
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You may want to add the error messages to give me a clue. Too much christmas drink doesnt help my brain 
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
|

12-26-08, 07:09 PM
|
 |
Wannabe Coder
|
|
Join Date: Aug 2008
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
there is no error, it just doesn't save the web pages.
|

12-26-08, 07:15 PM
|
 |
Code Master
|
|
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If there is no error then I would suggest looking on your webserver for the file as paths can be funny things. I often have problems with relative paths and I once had a file on my server called "myimage/1_10002_112.jpg" instead of it actually creating the file in myimage directory it created it part of the name
Check your webserver for the file, its probably in a weird place and try get the relative path (i used my hosts control pannel to find out what the path was)
Cheers
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|