Re: [PHP] Parsing Strings

2008-12-07 Thread German Geek
Why not preg_split ( http://nz.php.net/manual/en/function.preg-split.php ): $str = 'SCOTTSDALE, AZ 85254'; $ar = preg_split('/,? ?/', $str); //optional comma, followed by optional space // $ar = array('SCOTTSDALE', 'AZ', '85254'); On Sat, Dec 6, 2008 at 1:18 PM, Jason Todd Slack-Moehrle < [EMAIL

Re: [PHP] Parsing Strings

2008-12-06 Thread Nathan Rixham
tedd wrote: At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote: How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote: OK, making good learning progress today. I have a string that is

Re: [PHP] Parsing Strings

2008-12-06 Thread VamVan
u can use split() or explode (). Thanks On Sat, Dec 6, 2008 at 9:27 AM, tedd <[EMAIL PROTECTED]> wrote: > At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote: > >> How might I also parse and address like: SCOTTSDALE, AZ 85254 >> >> It has a comma and a space >> >> -Jason >> >> On Dec 5, 200

Re: [PHP] Parsing Strings

2008-12-06 Thread tedd
At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote: How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote: OK, making good learning progress today. I have a string that is: Jason Slack

Re: [PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote: OK, making good learning progress today. I have a string that is: Jason Slack and I want it broken at the space so i get Jason and the

Re: [PHP] Parsing Strings

2007-10-15 Thread Philip Thompson
On 10/15/07, Richard Heyes <[EMAIL PROTECTED]> wrote: > > Philip Thompson wrote: > > ... > > $str = 'thisIsAStringIHave'; > > echo ucfirst(preg_replace('/([A-Z])/', ' $1', $str)); > ?> > > HTH Ha! I knew there was a much easier way. My brain is still not working this Monday morning

Re: [PHP] Parsing Strings

2007-10-15 Thread Richard Heyes
Philip Thompson wrote: > ... HTH -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Parsing Strings

2007-10-15 Thread Andrew Ballard
On 10/15/07, Philip Thompson <[EMAIL PROTECTED]> wrote: > Hi. > > Before I try and reinvent the wheel, I thought I'd query the list. I want to > take this string: > > thisIsAStringIHave > > and turn it into: > > This Is A String I Have > > Essentially, I want to capitalize the first letter (ucfirst