I know a version of this but i'm looking for the simplest开发者_开发百科 way?
$string = "HeLLo$ my222 name is zolee0802343134";
$string = strtolower($string);
$replacement = range (a, z);
$replacement2 = range (0, 9);
//
What comes here?
//
I want to get this ->
$string = "hello my name is zolee";
Use regex for simplicity.
$string = "HeLLo$ my222 name is zolee0802343134";
echo preg_replace("/[^a-z ]/i", "", $string);
http://codepad.org/eDmXrnYR
Here you go: http://codepad.org/3KuCG2yf
<?php
$string = "HeLLo$ my222 name is zolee0802343134";
echo preg_replace("/[^a-zA-Z ]/", "", $string);
?>
精彩评论