0 Users appreciate this thread.
PHP Emoticons?
SPCOxion (2014-05-28 05:59:10)The same thing happened to me with a censor() function
Someone typed 'Advertisement', and it returned 'Adverti*****t'
All I did was add spaces around it.
Source Code
preg_replace($input, array(' semen', 'semen ', ' semen '
,
array(' *****', '***** ', ' ***** '
);
preg_replace($input, array(' semen', 'semen ', ' semen '
(Apologies if the code is wrong, lel. It's been forever since I've used/edited/looked at it)
Just edit your code to do something like that.
...and, if that doesn't work, call me an idiot and listen to what Mega says
2014-06-02 12:24:03
angelrulez7 (2014-05-29 03:28:49)My problem is that I want them to work when there's no spaces, as long as there's no character in front of it.
a
CoolApps (2014-05-29 19:44:14)^^^ So it wouldn't get in eehhhhhhh I mean nothing...
I would use str_replace() or use an other strategy with the array() function.
Can you put the actual code in http://notepad.cc?
2014-05-30 02:46:40
Newer account: NodePoint
SPCOxion (2014-06-02 05:23:34)As long as there's no character in front of it?
Define 'character'.
If 'character' means 'space', then that's cpvered in the code I posted.
I highlighted the whitespace in front of the words and what I'm replacing them with, just so it's easier to see.
angelrulez7 (2014-06-05 06:46:48)That will take long to redo, but I gotta do what I gotta do.
What if somebody, like for their bio, is just an emote, and it doesn't work?
a
This topic is closed, so you can not post a comment.
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes
I've been working on an emoticon system for a while, and it doesn't work EXACTLY how I want to. :/
[code=*php]<?php
/* Emote function by Neonacid64 */
function emote($text){
$icons = array(
'Below' => '<img src="/emote/smile.png" alt="
'Below' => '<img src="/emote/unhappy.png" alt="
'Below' => '<img src="/emote/wink.png" alt="
'Below' => '<img src="/emote/mad.png" alt="
'These don't work due to plaza' => '<img src="/emote/happy.png" alt="
'These don't work due to plaza' => '<img src="/emote/unsure.png" alt=":/">'
);
return strtr($text,$icons);
}
echo emote("http:// :/" );
?>
[/code]
This is the result.
What I want to happen is that it won't work if it's part of a word, like http:// or that stupid "
I tried Stack Overflow. No help.
How do I do this?
2014-05-27 08:02:29