|
Posted by Toby A Inkster on 05/09/07 14:58
Krustov wrote:
>> As far as I can tell, your entire 40-line include file can be replaced with:
>> $p = preg_replace('/[^0-9]/', '', $p);
>> which is only 40 characters.
>
> The $ok string can contain any characters and its a lot easier and
> faster to duplicate/rename the file than it is to learn expressions .
You think it's faster to duplicate, rename and modify that file than it is
to change this:
$p = preg_replace('/[^0-9]/', '', $p);
to, say, this:
$p = preg_replace('/[^AaEeIiOoUu]/', '', $p);
?!
(That regular expression removes everything except vowels.)
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
Navigation:
[Reply to this message]
|