/ Published in: PHP
If you are a PHP developer, you are probably aware that you can pass an array of strings as the search strings and an array as the replacements to the str_replace function. In this example you can see how to automatically replace smiley shortcuts by an image.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function emoticons($text) { ); foreach ($emoticons as $key => $emoticon) { } return $text; } echo emoticons('This is :) a text ;-) with :-) emoticons 8)'); ?>
URL: http://www.flashstar.nl/article-37.html