
July 26th, 2004
12:40 AM
No, it's the hard breaks.
I'll try the /n.
I also tried the nl2br before, didn't have luck.
EDIT:
doesn't work. 

July 26th, 2004
12:47 AM
what could you possibly want to know about me?
Status: Offline!
not /n - it must be \n
Edit: actually, I think pureevils's method is the best -
you should use that. Did you remember to assign the
result back into $theshout? (It really should work)
<?php
$theshout = nl2br($theshout)
?>
Last edited by sabrina, July 26th, 2004 12:55 AM (Edited 1 times)

July 26th, 2004
12:54 AM
Neversidian
Status: Offline!
i tryed ur code and it seems to work
http://aonic.net/tests/Untitled-1a.php?s=o_O
<?php
$smile = array(
':\)' => '<img src="emoticons/smile.gif" alt=":\)" />',
'
' => '<img src="emoticons/sad.gif" alt="
" />',
':\D' => '<img src="emoticons/biggrin.gif" alt=":\D" />',
'o_O' => '<img src="emoticons/blink.gif" alt="o_O" />',
'
' => '<img src="emoticons/mellow.gif" alt="
" />',
'B-)' => '<img src="emoticons/cool.gif" alt="B-)" />',
'^_^' => '<img src="emoticons/happy.gif" alt="^_^" />',
':P' => '<img src="emoticons/tongue.gif" alt=":P" />',
'
' => '<img src="emoticons/laugh.gif" alt="
" />',
':\ohmy:' => '<img src="emoticons/ohmy.gif" alt=":\ohmy:" />',
';\)' => '<img src="emoticons/wink.gif" alt=";\)" />',
':wub:' => '<img src="emoticons/wub.gif" alt=":wub:" />',
':\mad:' => '<img src="emoticons/mad.gif" alt=":\mad:" />',
'-_-' => '<img src="emoticons/sleep.gif" alt="-_-" />',
':dry:' => '<img src="emoticons/dry.gif" alt=":dry:" />',
':ninja:' => '<img src="emoticons/ninja.gif" alt=":ninja:" />'
);
$stuff = $_GET['s'];
echo str_replace(array_keys($smile), array_values($smile), $stuff);
?>
___________________
-Developer
-Forum Leader
-NeverNET

July 26th, 2004
09:09 AM
So what's up :)
Status: Offline!
I think this is easier for smiles :)
<?php
$smile = array(
':)' => '<img src="emoticons/smile.gif" alt=":)" />',
':(' => '<img src="emoticons/sad.gif" alt=":(" />',
':D' => '<img src="emoticons/biggrin.gif" alt=":D" />',
'o_O' => '<img src="emoticons/blink.gif" alt="o_O" />',
':|' => '<img src="emoticons/mellow.gif" alt=":|" />',
'B-)' => '<img src="emoticons/cool.gif" alt="B-)" />',
'^_^' => '<img src="emoticons/happy.gif" alt="^_^" />',
':P' => '<img src="emoticons/tongue.gif" alt=":P" />',
':lol:' => '<img src="emoticons/laugh.gif" alt=":lol:" />',
':ohmy:' => '<img src="emoticons/ohmy.gif" alt=":ohmy:" />',
';)' => '<img src="emoticons/wink.gif" alt=";)" />',
':wub:' => '<img src="emoticons/wub.gif" alt=":wub:" />',
':mad:' => '<img src="emoticons/mad.gif" alt=":mad:" />',
'-_-' => '<img src="emoticons/sleep.gif" alt="-_-" />',
':dry:' => '<img src="emoticons/dry.gif" alt=":dry:" />',
':ninja:' => '<img src="emoticons/ninja.gif" alt=":ninja:" />'
);
$theshout = nl2br(strtr($theshout,$smile));
?>
___________________
"¿Por qué buscais la felicidad, oh, mortales, fuera de vosotros mismos?"
~Boecio

July 27th, 2004
06:13 PM
Neversidian
Status: Offline!
http://php.net/strtr
___________________
-Developer
-Forum Leader
-NeverNET

July 27th, 2004
09:30 PM
Neversidian
Status: Offline!
its basically the same thing. however in some weird cases you can get weird results with that method. but i must emphasize some cases
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

July 27th, 2004
10:21 PM
Praise you Alekz! 
Thanks very much! 