Need help with arrays in php
Posted: Thu Jun 11, 2009 10:33 pm
I have a textbox -"textfield0" on a form. The user can enter as many phrases as he/she wants.The text in each line is a phrase.
There is another textbox-"textarea2" which should display each phrase which is entered in textfield0 to a new line in textarea2.(Each line should be copied as is)I am trying to use array here but the code isn't working. If someone can point out what am I doing wrong and how can I correct it.
Thanks
There is another textbox-"textarea2" which should display each phrase which is entered in textfield0 to a new line in textarea2.(Each line should be copied as is)I am trying to use array here but the code isn't working. If someone can point out what am I doing wrong and how can I correct it.
Code: Select all
$phrase = array('textfield0');
foreach($phrase as $val)
{
print"$val<BR>";
// this code doesn't work
}