PDA

View Full Version : Separating text input with commas


earthman
01-16-2007, 02:47 PM
Hi all,

If i want to ask a user for a series of info separated by commas in a text box, how do i retrieve the data as individual variables between the commas?

eg

"stella, guiness, strongbow, black sheep, old speckled hen"

are inputted as a users favourite drinks. The list could go up to over 100 in theory. I want to grab each string between the commas and call it "variableX" where X is a number for example.

Any ideas?

Cheers in advance

tsnyder91
01-16-2007, 04:00 PM
Rather than just telling you,

http://us2.php.net/manual/en/function.explode.php