|
Posted by Jerry Stuckle on 10/29/07 21:29
joanna wrote:
> Hi, I'm using preg_replace to strip out a bunch of unwanted stuff from
> the database. However the results seem to bunch up. Here's what I'm
> doing
>
> $old = htmlspecialchars($row['name']);
>
> $new = preg_replace("/[^a-zA-Zs]/", "", $old);
>
> the results of this are
>
> TomSmith
>
> instead of
>
> Tom Smith
>
> What do I need to add to the expression to get the desired space
> between words?
>
>
Untried, but maybe something like:
$new = preg_replace("/[^a-zA-Z\s]/", "", $old);
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|