Re: Removing Spaces from Array Values
| From: | kvigor | Date: | Tue, 03 Jul 2007 05:20:31 +0000 |
| Subject: | Re: Removing Spaces from Array Values | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258070@lists.php.net to get a copy of this message | ||
I meant to say: Got It, My bad, I really feel SHEEPISH... should have
done...
This is what happens when you're trying to code with a migraine, You start
speaking another language.
Thanks Again
""kvigor"" <k3cheese@insightbb.com> wrote in message
news:9C.10.38873.D9CC9864@pb1.pair.com...
> Got I'm my bad I really feel SHEEPISH... s/b have done '$someArray ='
> Re-read what I thought I read a it worked like a dream.
>
> Thanks Adam
>
>
> "Adam Schroeder" <amschroeder@ucdavis.edu> wrote in message
> news:4689AB3C.2070907@ucdavis.edu...
>> The function str_replace() DOES NOT change the parameter. Rather,
>> str_replace() returns the desired string. Try changing your code to:
>>
>>
>> for($num = 0; $cntr < $num; $cntr++)
>> {
>> $someArray[$num] = str_replace(' ','',$someArray[$num]);
>> echo "$someArray[$num]<br />";
>> }
>>
>>
>>
>> http://us.php.net/manual/en/function.str-replace.php
>>
>>
>> Adam
>>
>> kvigor wrote:
>>
>>>Need to remove all spaces from Array Values... And this doesn't work.
>>>
>>>This is similar info that's within array values: $someArray[0] = "PHP is
>>>awesome"; s/b PHPisawesome
>>>This is similar info that's within array values: $someArray[1] = "The Toy
>>>Boat"; s/b TheToyBoat
>>>
>>>Begin Code===================================
>>>$num = count($someArray);
>>>
>>>for($num = 0; $cntr < $num; $cntr++)
>>>{
>>> str_replace(' ','',$someArray[$num]);
>>> echo "$someArray[$num]<br />";
>>>}
>>>End Code===================================
>>>