Re: Re: comparing strings - again!

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

 



ross@xxxxxxxxxxxxx wrote:
> var_dump gives
> 
> Company Director string(17)
> 
> Company Director string(16)
> 
> Why would they be different? 

probably because there is either:

1. white space in the value in your data source
2. white space being outputted along side the value when creating a form field weith that valu

that and/or possible the fact that your doing a trim()
in one place but not in another - personally I usually trim() incoming string data
(regardless of any other validation/sanitation) to avoid stuff like this

> Seems like they have add some extra
> whitespace?

exactly. btw: var_dump() should be showing exactly where the white space is e.g.:


code:
<?php
$s1 = "Company Director "; $s2 = "Company Director"; var_dump($s1, $s2);

output:
string(17) "Company Director "
string(16) "Company Director"

-- 
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