From: Richard Quadling on 23 Jun 2010 05:41 On 23 June 2010 01:03, Rick Dwyer <rpdwyer(a)earthlink.net> wrote: > $find = '/[^a-z0-9]/i'; Replace that with ... $find = '/[^a-z0-9]++/i'; And now you only need ... $new_string = trim(preg_replace($find, $replace, $old_string)); -- ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling
First
|
Prev
|
Pages: 1 2 3 4 Prev: Warning messages on web page. Next: In what scenario an extension of a class is useful? |