Regular expressions? What's that? Part 2.

Posted by Stanislav Furman  on June 2, 2014

Thanks to nightbloos I can continue posting funny code samples that developers meet/write from time to time. :)

Here is another good example of how NOT to do! Please, do not try this at home! This stunt was performed by untrained professionals.  :)


<?php
$forReplace = array(",","."," ","-", "+", "#""/");
foreach($forReplace as $repl){
	$find = str_replace($repl,'',$find)
}

Obviously, in this case a regular expression function must have been used.

If you have another good examples of a funny code samples, please leave it in the comments. ;)


Leave your comment

Fields with * are required.

* When you submit a comment, you agree with Terms and Conditions of Use.