Regular expressions? What's that?
Posted by Stanislav Furman
Apparently, the person who wrote this code has never heard about regular expressions. :)
<?php
$find = str_replace(",", "", $find);
$find = str_replace(".", "", $find);
$find = str_replace("/", "", $find);
$find = str_replace(" ", "", $find);
$find = str_replace("-", "", $find);
$find = str_replace("+", "", $find);
$find = str_replace("#", "", $find);
?>
Please, never repeat this! :)
Comments
$forReplace = array(",",
".",
" ",
"-",
"+",
"#"
"/");
foreach($forReplace as $repl){
$find = str_replace($repl,'',$find)
}
Leave your comment