strcmp
#1

Hi,

If i strcmp empty string it return as it match or no? because in sa-mp if you strcmp empty string it always give that is match?
Reply
#2

Check the important notes this wiki page.
Reply
#3

I know but i talk about php strcmp if i compare empty string with non empty it return that it matches or no? is there same bug as in samp strcmp ?
Reply
#4

Dude, just search for that php function on ****** and if you don't find what you want, it takes only a few seconds to test it yourself. You're going to learn a lot more when you find things yourself instead of other people telling you.
Reply
#5

If strcmp("", "") then yes.
Reply
#6

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
If strcmp("", "") then yes.
That's not what he means. He means this note from the wiki:
Quote:

This function returns 0 if either string is empty. Check for null strings with isnull(). If you do not, for example, people can login to anyone's account by simply entering a blank password.

Reply
#7

Quote:
Originally Posted by Freaksken
Посмотреть сообщение
That's not what he means. He means this note from the wiki:
His other reply touched PHP.
Quote:
Originally Posted by Bussyman
Посмотреть сообщение
I know but i talk about php strcmp if i compare empty string with non empty it return that it matches or no? is there same bug as in samp strcmp ?
Whether PHP strcmp function has the same issue that SAMP's strcmp has (the one you mentioned)

In terms of PHP, strcmp will return 0 (match)
(tested it before I replied)


EDIT:
Must also note that
PHP код:
echo strcmp("","bug"); // -3 
PHP код:
echo strcmp("bug",""); // 3 
Reply
#8

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
His other reply touched PHP.
Whether PHP strcmp function has the same issue that SAMP's strcmp has (the one you mentioned)
Yeah, I know, that's what I meant ...

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
PHP код:
echo strcmp("","bug"); // -3 
PHP код:
echo strcmp("bug",""); // 3 
I really don't agree with people being spoonfed the answer when it's so easy to find out themselves. They'll never learn this way.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)