Jump to content


- - - - -

Cool PHP functions


1 reply to this topic

#1 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 15 February 2008 - 10:30 PM

Every now and then I come accross a PHP function that I wish I new about ages ago that would have saved SOOO much time and effort stuffing around. So I thought I would share... Perhaps you have a function that you think everyone should know about too?

nl2br() "NewLine to(2) Break"

Inserts a <br /> at each instance of \n. when the php string is returned for use in html.

eg:$string="Row 1. \n Row2. \n";
$output=nl2br($string);
return $output;

would show:
Row1.<br />
Row2.<br />

:dance:

http://www.w3schools.com/php/func_string_nl2br.asp
http://php.net/nl2br

#2 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 15 February 2008 - 11:40 PM

You'll have those experiences... Every so often I have to go back and have another look at array, string, or mysql, and just about every other category of functions to see how I can make my life easier...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users