Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

turning ascii smilies into smiley.gif PHP

Name: Anonymous 2008-12-03 5:22

Does this look right?
$comment = str_replace(":D", "<img src='myimage.gif' alt=':D' />");

It will be for the comment system seen here.
http://www.plentyoftorrents.com/flsh/animation/princess-1

Also would this replace any :D that is already posted or just when someone makes a post after its put in.

Name: Anonymous 2010-05-30 8:46

>>1
Also would this replace any :D that is already posted or just when someone makes a post after its put in.
Why the fuck are you asking us? How the hell would we know, when you, the developer, have no clue?
"Programmers" these days...

Name: Anonymous 2010-05-30 11:02

$str = str_replace(':D','<img src="smiley.png" alt=":D"/>',$str);

Bonus:
Use RegEx to make sure theres a space on either side (and don't replace it).

Also:
PHP fails, you fail, 4chan fails, get the fuck out of this board.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List