Jump to content

Recommended Posts

guys,

 

i need help

 

i have a form wherein in i have a textarea name="requirements"

example of the text i am typing there is

 

item1

item2

item3

item4

 

and this text will then be submitted and saved to my database

 

my problem now is

when i view it in my view page

 

the format of the text i typed is

 

item1item2item3item4

 

how do i fix this wherein

when i view it in my view page

the output will be

 

* item1

* item2

* item3

* item4

 

need help on this please!

 

thanks in advance!

Do you have any sort of punctuation or symbols in between the items or does it simply look like: applesorangesbananaspearsfruits?

 

If you have symbols, or you can add them, you can use explode() and then loop through the array to display them in a list.

each item should have a new line after it \n

 

you could do

 

$list = expolode("\n", $data); //i think the double quote will mater here

$count = count($list);

 

$disp = "<ul>\n";

for($i = 0; $i < $count; $i++){

$disp .= "<li>". $data[$i] ."</li>\n";

}

echo $disp .= "</ul>\n";

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.