for eamon:
preg_replace is wonderful for that sort of thing, amongst so
much else.
<?php
$string = "a string with!0o|u7t stuf34-f2~ in#4 in
it";
// No numbers
$string = preg_replace("![0-9]!", "",
$string);
// $string is now "a string with!o|ut stuf-f~ in# in
it"
// Nothing but alphabetic
$string = preg_replace("![^0-9A-Za-zs]!",
"", $string);
// $string is now "a string without stuff in in
it"
?>
----
Server IP: 69.147.83.197
Probable Submitter: 76.166.158.229
----
Manual Page -- http
://www.php.net/manual/en/function.strstr.php
Edit -- https://master
.php.net/note/edit/78029
Del: integrated -- h
ttps://master.php.net/note/delete/78029/integrated
Del: useless -- http
s://master.php.net/note/delete/78029/useless
Del: bad code -- htt
ps://master.php.net/note/delete/78029/bad+code
Del: spam -- https:/
/master.php.net/note/delete/78029/spam
Del: non-english --
https://master.php.net/note/delete/78029/non-english
Del: in docs -- http
s://master.php.net/note/delete/78029/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78029
Reject -- https://mast
er.php.net/note/reject/78029
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|