Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
133
rated 0 times [  139] [ 6]  / answers: 1 / hits: 21699  / 14 Years ago, thu, december 9, 2010, 12:00:00

How do I insert a smiley in the HTML programatically? I want to know the logic as how does it exist along with text? Is it a styled ASCII character or something? thanks in advance.


More From » html

 Answers
71

Assuming you mean smilies as found in various forums, you simply replace the ASCII smiley with a HTML img element on the server side. The output will look like this:



<p>This is a paragraph <img src=wink.png alt=;)></p>


Most of the time this is achieved using e.g. the PHP str_replace function.


[#94671] Tuesday, December 7, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
darennevina

Total Points: 422
Total Questions: 128
Total Answers: 105

Location: Comoros
Member since Tue, Mar 14, 2023
1 Year ago
;