Forum Moderators: coopster

Message Too Old, No Replies

nl2br like function

for lists

         

benihana

1:39 pm on Mar 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I very rarely use any php, so please bear with me.

Im after a function to do the same as nl2br but to output:

</li><li> (to close the previous item and open the next)

is there anything like this available?

Cheers

Nutter

2:47 pm on Mar 7, 2005 (gmt 0)

10+ Year Member



You could - strreplace("\n", "</li><li>", $variable); - You'd also have to put a <li> in front of all that and a </li> at the end.

benihana

3:25 pm on Mar 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks v much - that worked.

for the record, i had to use str_replace - is that a php version issue?

cheers

Nutter

3:30 pm on Mar 7, 2005 (gmt 0)

10+ Year Member



No, it was probably just a typo on my part :)