title: single function for emotions,links,preserving line breaks and wordwrap
body: <p>Hello all i am working on a project where i need to have find any url/links/emails, preserve the line brakes,replace the special symbol with emotions and also wordwrap. so i was wondering that if all these things are possible with only a single function or not currently i am using this function for emotions</p>
  
  <pre><code>function emotions($text) {
  $icons = array(
          ':)'    =&gt;  '&lt;img src="smiles/smilee.png" class="icon_smile" title="smiling :)"/&gt;',
          ':d'    =&gt;  '&lt;img src="smiles/lol.gif" class="icon_smile" title="Laughing :d"/&gt;',
          ';)'    =&gt;  '&lt;img src="smiles/wink.png" class="icon_smile" title="Wink ;)"/&gt;',
          ':p'    =&gt;  '&lt;img src="smiles/tongue.png" class="icon_smile" title="Tounge :p"/&gt;',
          ':('    =&gt;  '&lt;img src="smiles/sad.png"  class="icon_smile" title="Sad face :("/&gt;',
          ':o'    =&gt;  '&lt;img src="smiles/shock.png" class="icon_smile" title="Shocking :o"/&gt;',
          ':|'    =&gt;  '&lt;img src="smiles/straight.png" class="icon_smile" title="straight :|"/&gt;',
          '&lt;3'   =&gt;  '&lt;img src="smiles/heart.png" class="heart" title="Heart &lt;3"/&gt;',
          '::s'   =&gt;  '&lt;img src="smiles/sexy.png" class="icon_smile" title="Sexy &lt;s"/&gt;',
          ':D'   =&gt;  '&lt;img src="smiles/lols.gif" class="icon_smile" title="lol :D"/&gt;',
  
          ':(('   =&gt;  '&lt;img src="smiles/cry.gif" class="icon_smile" title="crying :(("/&gt;',
          ':X'   =&gt;  '&lt;img src="smiles/silent.gif" class="icon_smile" title="sealed lips :X"/&gt;',
          ':B'   =&gt;  '&lt;img src="smiles/bla.gif" style="width:29px;vertical-align:middle;" title="bla bla :B"/&gt;',
          ':C'   =&gt;  '&lt;img src="smiles/coll.gif" style="width:24px;vertical-align:middle;" title="coll me :C"/&gt;'
  );
  return strtr($text, $icons);
  }
  
  ?&gt;
  </code></pre>
  
  <p>and i know that for wordwrap i can use the function wordwrap and for line brakes nl2br but i want all these in a single function please help me with this</p>