/    Sign up×
Community /Pin to ProfileBookmark

insering smiles icons in the text?

Hi
I was always wondering how this and other forums insert smile icons in the text. I understand that say we have something like *smile* and then some sort of function have to detect that and concet to <img> and show ?

Can some on show me that function or at least tell me how it works?
Tnx!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Aug 22.2007 — [code=php]
$oldstr= "*smile*";
$imgstr = str_replace("*smile*",'<img src="smile.gif" alt="Smile" />', $oldstr);
[/code]
Copy linkTweet thisAlerts:
@alexusauthorAug 22.2007 — oh that was simple ?

Thanks!
×

Success!

Help @alexus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...