PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
dude81
Forum Regular
Posts: 509 Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City
Post
by dude81 » Thu Mar 16, 2006 7:12 am
Back after long time
str_replace(
)
will trunc the last space right .. this is my first regex help me...
Skittlewidth
Forum Contributor
Posts: 389 Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK
Post
by Skittlewidth » Thu Mar 16, 2006 7:16 am
Why not just use trim(), ltrim() or rtrim()?
dude81
Forum Regular
Posts: 509 Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City
Post
by dude81 » Thu Mar 16, 2006 7:26 am
I know that, but Im learning regular expressions... this a tutorial work
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Thu Mar 16, 2006 7:40 am
Well you've used the wrong function
str_replace() doesn't know regex.
You need
preg_replace()