Created
February 25, 2021 04:15
-
-
Save fadhil-riyanto/64c2bf7226110f0f6fd37fa51ca4b96f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$Block = array('asu','bangsat', 'njir'); // kata yang ingin diblok | |
$String = "asu, tadi njir, tadi ada orang bangsat !"; | |
$String = preg_replace("/(\b|[0-9_])(".implode('|',$Block).")(\b|[0-9_])/i", '***', $String); | |
echo $String; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment