For the purpose of testing, this is the code that I am using on my regular expression: < Pre> Now, all the printing is the exact string such that no changes were made, why any ideas? You should finally use delimiter and start your pattern, for example Note that you can use other delimiter: & lt ;? Php function handphone ($ p) {return preg_replace ("[^ 0- 9xX \ +]", "", $ p); } Echo handphone ("+ 44 (324) -123-32 yukek 42x123"); ? & Gt;
/ :
function handlephone ($ p) {return preg_replace ("/ [^ 0- 9xX \ +] /", "", $ p); }
~
#
@ . .
No comments:
Post a Comment