Ämne: regex +php
Visa ett inlägg
Oläst 2007-04-23, 16:35 #3
Per Per är inte uppkopplad
Supermoderator
 
Reg.datum: Apr 2003
Inlägg: 719
Per Per är inte uppkopplad
Supermoderator
 
Reg.datum: Apr 2003
Inlägg: 719
Kod:
function foo($str, $allowed_values) { 
 return preg_replace('#[^'.$allowed_values.']#', '', $str); 
} 
echo foo('=)(009asda', '0-9a-zåäö');
En variant.
__________________
www.ip2nation.com (ip till land)
Per är inte uppkopplad   Svara med citatSvara med citat