/    Sign up×
Community /Pin to ProfileBookmark

Please Help Me……..

hi ,
i want a function ,
Please help me,,,,,,,, ?
when user post reply

[code=php]
$reply=”Hello this is testing message”; //user reply text
$res=mysql_query(“select * from wordfilter”);
while ($row=mysql_fetch_array($res)){
$word=$row[‘words’]; // delete, insert, drop , etc……….
}
[/code]

if $reply any word match to $word then he replace it
first word and last word same and middle word replace to *****

forexemple he found sexy and hi also in my databe (in $word) then he replace it s**y
if hi found one word then replace one
if found two word then two …..there ……. four ……………………………………………………………………..

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@kurniawanMar 20.2010 — Do you mean "replacing it when displaying" or "replacing it inside mysql db"?

Which one? If you mean replacing when displaying it then you can use :

str_replace()

docs : http://jp.php.net/manual/en/function.str-replace.php

preg_replace

docs : http://jp.php.net/manual/en/function.preg-replace.php
Copy linkTweet thisAlerts:
@aadiauthorMar 21.2010 — i found it (and this is helpful for me)

http://forums.digitalpoint.com/showthread.php?t=1738477
×

Success!

Help @aadi 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...