NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Textarea to array trouble

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 04-17-2011, 07:14 AM THREAD STARTER               #1 (permalink)
 
BillyConnite's Avatar
Join Date: Jul 2005
Location: Coffs H, Australia
Posts: 3,456
BillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond reputeBillyConnite has a reputation beyond repute
 


Wildlife Parkinson's Disease Parkinson's Disease

Textarea to array trouble


Hi all,

I'm having trouble converting data from a textarea into an array (Seperating by new lines).

I have tried exploding based on "\r\n" and "\n" with no luck.

Anyone know how to do this properly?

Thanks,
Rhett.

---------- Post added 04-18-2011 at 12:14 AM ---------- Previous post was 04-17-2011 at 11:20 PM ----------
????: NamePros.com http://www.namepros.com/programming/711446-textarea-to-array-trouble.html

Oops, this has been solved, was a totally different issue i was having, values i was compaing had a tab in front of them i didn't notice ...

Sorry for the trouble.
BillyConnite is offline   Reply With Quote
Old 04-17-2011, 08:33 PM   #2 (permalink)
If only you knew...
 
maximum's Avatar
Join Date: Oct 2005
Location: Inside your head...
Posts: 990
maximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond repute
 


Child Abuse Special Olympics Save a Life Baby Health Autism
Have to love what you can't plainly see

PHP Code:
<?
if(in_array(array(" ","  ","→","┘","╛","╝"),$my_code)) {
die(
"[COLOR="Red"]Code is screwed![/COLOR]:eek:");
}
?>
Result:
Code is screwed!

GLAD you got it figured out
__________________
--- The greatest truths ever told, and the greatest lies ever told, all consist of exactly the same three words:
"I LOVE YOU"
--- The best say little, only say what is important.....then they shut up and sit down.
maximum is offline   Reply With Quote
Old 04-18-2011, 03:47 PM   #3 (permalink)
Account Suspended
Join Date: Dec 2008
Location: Boston, Ma
Posts: 650
CrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to all
 



Marrow Donor Program Animal Rescue Autism Autism

Just in case others would like to see the answer to how to do this.

PHP Code:
<?php
//make the array
$TAarray explode("\n"strip_tags($_POST['TAData']));

//loop through the array
foreach ($TAarray as $line) {
????: NamePros.com http://www.namepros.com/showthread.php?t=711446

       
$line htmlspecialchars(trim($line));
       
// then do something with each line here. us mysql_real_escape_string() if injecting into mySQL.
}
?>
Last edited by CrackFeed.Com; 04-18-2011 at 03:53 PM.
CrackFeed.Com is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
[php] Array Sorting liam_d Programming 1 07-07-2009 05:30 PM
[resolved] Passing numbers as array of integers ridesign1 Programming 2 11-24-2008 03:02 AM
Working with recursive functions within php Peter CODE 9 09-05-2007 04:39 AM
Whois search that grabs all data :) (php/linux needed) axilant CODE 1 09-08-2004 08:31 PM

 
All times are GMT -7. The time now is 02:46 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger