textarea to array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

textarea to array

Post by kingconnections »

ok, so say I have a text area, in which urls are pasted. I then want to store each of those items in an array. How can I go about accomplishing this.


What I want to accomplish is for someone to be able to paste some urls into the text area and then do something with them. In this case I would process each one by itself and evaluate it.
Thanks in advance.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Post by kingconnections »

Thanks! you the man.
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

Post by potato »

try this:

Code: Select all

$urls = $_POST['textarea'];
$urls = explode("/n", $urls);
after this the $urls is an array with the urls

i hope i helped you with this
Post Reply