All pastes #428780 Raw Edit

Someone

public text v1 · immutable
·published 2007-04-07 20:38 UTC
rendered paste body
$text = "hehe =D that was funny. Yeah I like tea to :P, though my cat can't have any =(";

$smilies = array(
				'=D' => 'happy.png',
				':P' => 'tounge.png',
				'=(' => 'sad.png',
				);
foreach( $smilies as $trigger=>$image ) {
	$text = preg_replace( '/'.$trigger.'/', '<img src="'.$image.'" alt="'.$trigger.'" />', $text );
}