Search:
Type: Posts; User: campbeld
Search: Search took 0.03 seconds.
-
08-31-2006, 12:40 AM
- Replies
- 19
- Views
- 2,462
For the reason strcmp is the correct way to...
For the reason strcmp is the correct way to compare strings please re-read the thread. Thanks.
-
08-30-2006, 02:49 AM
- Replies
- 19
- Views
- 2,462
I wondered where that post had gone! Anyway, I...
I wondered where that post had gone! Anyway, I must get on with things but I have learned so much from both of you.
Before I posted I had no idea that methods of string comparison in PHP were such... -
08-30-2006, 02:43 AM
- Replies
- 19
- Views
- 2,462
lexigraphic comparison comes into it's own when...
lexigraphic comparison comes into it's own when you're sorting..
So I guess we can say that use "==" just to see if two strings match but only if you can be absolutely certain you are comparing... -
08-30-2006, 02:39 AM
- Replies
- 19
- Views
- 2,462
yeah in hind site I should have made that more...
yeah in hind site I should have made that more clear...
oh your comment on traffic building makes me want to spark another topic because traffic building from forum posts is really really... -
08-30-2006, 02:36 AM
- Replies
- 19
- Views
- 2,462
strcmp is correct because it ignores programming...
strcmp is correct because it ignores programming types and does lexigraphic comparison which is more likely what people want
-
08-30-2006, 02:34 AM
- Replies
- 19
- Views
- 2,462
yes when people want to know the correct...
yes when people want to know the correct comparison operator to use it's usually because they try to compare a number with a string and get unexpected results
-
08-30-2006, 02:30 AM
- Replies
- 19
- Views
- 2,462
No the "===" operator requires both operators to...
No the "===" operator requires both operators to be the same type for the comparison to be successful.
For example,
if you have $stringa = "1" and $b = 1
and try
if ($stringa === $b)
{ -
08-30-2006, 02:27 AM
- Replies
- 19
- Views
- 2,462
No sorry the more I think about it I recommend...
No sorry the more I think about it I recommend using strcmp and related functions for comparing strings. And to avoid using "==" for string comparisons. Programmers can avoid many accidents that way....
-
08-30-2006, 02:17 AM
- Replies
- 19
- Views
- 2,462
ok can't edit post because it's past the 15...
ok can't edit post because it's past the 15 minute expiry
There are the string comparison operators and you can do
If ($stringa == $stringb)
{
// yes, the == operator says they're equal... -
08-30-2006, 02:09 AM
- Replies
- 19
- Views
- 2,462
Yes there are those functions but they do not...
Yes there are those functions but they do not produce correct results. I better edit my post. Thanks for that.
-
08-30-2006, 02:07 AM
- Replies
- 3
- Views
- 998
Ummm don't use auto_number! Create a separate...
Ummm don't use auto_number! Create a separate table to store your identifier sequence and manage your own identifiers.
Use a function "get_next_identifier" to provide the next unreserved... -
08-30-2006, 01:56 AM
- Replies
- 19
- Views
- 2,462
what is correct string comparison operator php
Do you want to check and see whether a string is the same as another string?
Or do you want to check and see whether one string comes alphabetically before another string?
The good news is PHP...
Results 1 to 12 of 12