-
PHP
(
http://www.lookjapan.com/forumdisplay.php?f=137)
Vesaire |
31 Ağustos 2016 14:02 |
PHP Sansür Fonksiyonu
Sansür fonksiyonu metininizdeki istemediğiniz kelimeleri bulup sansürler.
Fonksiyon:
PHP- Kodu:
<?php
function sansur($dosya,$metin) {
$words = explode(",", file_get_contents($dosya));
$replace = array();
foreach ($words as $key => $word)
{
$words[$key] = "/{$word}/i";
$replace[] = "(sansür)";
}
echo preg_replace($words, $replace, $metin);
}
?>
Kullanım:
PHP- Kodu:
<?
$string = "deneme len küfür etmek";
sansur("kufur.txt",$string);
?>
kufur.txt içeriği:
|
All times are GMT +3. The time now is 04:04. |
|
Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.