I have some problems with removing numbers and special characters. I want to remove all numbers and special characters from the input. Here's my code :
$input = $_POST["input"];
function preprocessing($input){
$input = trim(strtolower($input));
$remove = '/[^a-zA-Z0-9]/s';
$result = preg_split($remove, $input, -1, PREG_SPLIT_NO_EMPTY);
for($i = 0; $i < count($resultl); $i++){
$result[$i] = trim($result[$i]);
}
return $result;
}
String example : qwd qwd qwdqd123 13#$%^&*) ADDA ''''
Output : Array ( [0] => qwd [1] => qwd [2] => qwdqd123 [3] => 13 [4] => adda )
The numbers still appear on my string. How to solve this ? Thank you before.