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
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
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
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
Oups, sorry
mistake by copy & paste ;-)
On Sa 06.12.2008 01:30 Jason wrote:
> Can you explain how to do an address now into City, State, Zip
> Like: cortland, ny 13045
$string = "cortland, ny 13045";
$search = array(", ", ",");
$replace = array(" ", " ");
$newString = str_rep
Conny,
Can you explain how to do an address now into City, State, Zip
Like: cortland, ny 13045
$string = "cortland, ny 13045";
$search = array(", ", ",");
$replace = array(" ", " ");
$newString = str_replace($search, $replace, $string);
$array = explode(" ", $newString);
Ah ha! Nice that ma
Hi,
On Sa 06.12.2008 01:30 Jason wrote:
> Can you explain how to do an address now into City, State, Zip
> Like: cortland, ny 13045
Test this:
$string = "cortland, ny 13045";
$search = array(", ", ","); # if there is no space after the comma, we make
this ;-)
$replace = array(" ", " ");
$newStr
Konrad,
On Dec 5, 2008, at 4:22 PM, Konrad Priemer wrote:
$array = explode(" ", "Jason Slack");
Awesome, thanks, yup that does it.
Can you explain how to do an address now into City, State, Zip
Like: cortland, ny 13045
It has a comma and a space!
-Jason
--
PHP General Mailing List (htt
Hi,
Jason wrote:
> I have a string that is: Jason Slack
> and I want it broken at the space so i get Jason and then Slack
explode or split can do this.
$array = explode(" ", "Jason Slack");
Array
(
[0] => Jason
[1] => Slack
)
Greetings from Stuttgart
Conny
---
Firma Konrad Priemer
O
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
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 then Slack
I am looking at parse_str, but I dont get how to do it with a space.
The example is using []=.
Then I want to assign like:
$fname = "Jason";
$lname
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
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
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
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) and then put a
space in front of each uppercase letter. I didn't find a P
15 matches
Mail list logo