Wednesday, October 21, 2009

Filter text in PHP with str_replace

This trick is usually used to filter out comment or message to be displayed normally in the guest book form. For example words - words that included "bad php" after the submit it displayed "good php". Create a still hooked to the web 1.0 I'll try to share what little I know. Perhaps this is one of the few tricks that can be used to filter out comment in php. Let us use the hassle of congenital str_replace function of php itself'll not bother to make their own functions. to consider the function is as follows str_repalce str_replace (the first parameter, second parameter, the third parameter) * The first parameter: this is a word or phrase that will be filtered * The second parameter: this is a substitute word for the first part * The third parameter: this is a word or phrase that will be filtered

3 comments:

citromduro said...

kunjungan balik

tidak bisa komen sekedar isi aja, bancaya sulit sih

JALOE said...

php.. ehm ane belum nyampe uy..

Cyril said...

Thanks a lot!

When learning php this tutorial on str_replace and the tutorials at Bright-Tutorials were helpful to me.

Post a Comment