Adam Khoury

Donate funds to show love and support

Click the button below to donate funds securely online. You can use your PayPal account or a credit card.

Your donations help free up my time to produce more content and assist in covering server costs. It's also a great way to say thanks for the content!

Application Configuration

Adam will be adding options here soon.

Replace Characters with Emoticon Icons Array Tutorial

Published :
Author :
Adam Khoury
Learn to use PHP to change character sequences into emoticons or icons by using the str_replace function. You will want to alter the string data as it comes out of the MySQL database for display, not when the data is being inserted into the database. <?php $db_str = "Show me some <3 right now. It is raining today [umbr], that gives me peace [peace]."; echo $db_str; echo "<hr />"; $chars = array("<3", "[peace]", "[umbr]"); $icons = array("&#10084;", "&#9774;", "&#9730;"); $new_str = str_replace($chars,$icons,$db_str); echo $new_str; ?>