first commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/practice
|
||||||
22
exam52/WordCensoring.php
Executable file
22
exam52/WordCensoring.php
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
//Word censoring
|
||||||
|
|
||||||
|
$find = array('alex','billy','dale');
|
||||||
|
$replace = array('a**x', 'b***y', 'd**e');
|
||||||
|
|
||||||
|
|
||||||
|
if(isset($_POST["user_input"]) && !empty($_POST["user_input"])){
|
||||||
|
$user_input = $_POST['user_input'];
|
||||||
|
$user_input_new = str_ireplace($find, $replace, $user_input);
|
||||||
|
|
||||||
|
echo $user_input_new;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form action="part2.php" method="POST">
|
||||||
|
<textarea name="user_input" cols="30" rows="6"><?php echo $user_input ;?></textarea><br><br>
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
|
||||||
|
</form>
|
||||||
Reference in New Issue
Block a user