groovygarden
Programmer
- Aug 23, 2001
- 63
Hi, Hope someone can help or point me in the direction of help....!
I'm trying to compare two strings. When I echo the strings they are exactly the same (or at least they appear exactly the same, yet when I compare them using
or
...I don't get a match. $list is an array of names created from a mysql select statement (spaces are encoded with ). $selected is a value the user has selected from a listbox. Does this have something to do with it?
Cases match fine and there are no leading/trailing spaces and I've tried encoding the spaces in $selected as well. Nothing seems to work!
Any help on this one much appreciated as I'm pretty much stuck if I can't compare these two strings!
Thanks a lot
I'm trying to compare two strings. When I echo the strings they are exactly the same (or at least they appear exactly the same, yet when I compare them using
Code:
$list[$i]==$selected
Code:
strcmp($selected, $list[$i])
...I don't get a match. $list is an array of names created from a mysql select statement (spaces are encoded with ). $selected is a value the user has selected from a listbox. Does this have something to do with it?
Cases match fine and there are no leading/trailing spaces and I've tried encoding the spaces in $selected as well. Nothing seems to work!
Any help on this one much appreciated as I'm pretty much stuck if I can't compare these two strings!
Thanks a lot