Re: Re: problem with slash / characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



just did some further testing, and even if I remove the special characters,
the 3rd character in that string becomes a 1.

I change it to Company XYZ,
and it looks right when its assigned to the array the first time, and on the
next iteration of the loop. but after that, it looks lke Co1pany XYZ.

On Wed, Oct 1, 2008 at 12:18 PM, Tanner Postert <tanner.postert@xxxxxxxxx>wrote:

> very, strange.
>
> if I change it to c / o Company XYZ ( with spaces between each character)
> it becomes: c 1 o Company XYZ.
> if I change it to c#o Company XYZ it becomes c1o Company XYZ
>
>
> On Wed, Oct 1, 2008 at 12:16 PM, Al <news@xxxxxxxxxxxxx> wrote:
>
>>
>>
>> Tanner Postert wrote:
>>
>>> ignore previous. sorry.
>>>
>>> I'm trying to display values from a database, the values come from the
>>> database like this:
>>>
>>> [0] => Array
>>> (
>>>   [id] => 5
>>>   [order_id] => 10
>>>   [key] => ship_to_name
>>>   [value] => John Anderson
>>> )
>>> [1] => Array
>>> (
>>>   [id] => 6
>>>   [order_id] => 10
>>>   [key] => ship_to_address
>>>   [value] => c/o Company XYZ
>>> )
>>>
>>> etc.
>>>
>>> so i am rolling thru that array and making a new array by:
>>>
>>> foreach ( $data as $k = $v ) {
>>>  $new[$v['key']] = $v['value'];
>>> }
>>> so that i have 1 array.
>>>
>>> The problem is that somewhere along the way the string "c/o Company XYZ"
>>> is
>>> becoming c/1 Company XYZ.
>>>
>>> I added a print_r after every iteration to see what its looking like
>>> along
>>> the way:
>>>
>>> foreach( $data as $k=>$v ) {
>>>  error_log( "new" . $v['key'] . " = " . $v['value'] );
>>>  $new[$v['key']] = $v['value'];
>>>  error_log( print_r( $new, true ) );
>>> }
>>>
>>> and I get:
>>>
>>> new ship_to_name = Gordon Anderson
>>> Array
>>> (
>>>    [ship_to_name] => Gordon Anderson
>>> )
>>> new ship_to_address = c/o Company XYZ
>>> Array
>>> (
>>>    [ship_to_name] => Gordon Anderson
>>>    [ship_to_address] => c/o Company XYZ
>>> )
>>> new ship_to_address_2 = 1100 S Baldwin
>>> Array
>>> (
>>>    [ship_to_name] => Gordon Anderson
>>>    [ship_to_address] => c/o Company XYZ
>>>    [ship_to_address_2] => 1100 S Baldwin
>>> )
>>> new ship_to_city = Oxford
>>> Array
>>> (
>>>    [ship_to_name] => Gordon Anderson
>>>    [ship_to_address] => c/1 Company XYZ
>>>    [ship_to_address_2] => 1100 S Baldwin
>>>    [ship_to_city] => Oxford
>>> )
>>> ... and it looks the same for the remaining iterations.
>>>
>>>
>>> how did the string change in the middle of that for loop?
>>>
>>> This also only happens on one machine. the production environment, which
>>> his
>>> Redhat, it doesn't happen on my development env, which is Fedora 9.
>>>
>>> Thanks in advance.
>>>
>>>
>> What happens if you change the "/" to another character, e.g., "#"?
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux