Can someone kindly help me understand more about Strcmp() function in PHP? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Can someone kindly help me understand more about Strcmp() function in PHP?

1st Jul 2022, 11:20 PM
Juma Muyaka
Juma Muyaka - avatar
3 Antworten
+ 5
Juma Muyaka The strcmp() function compares two strings. strcmp(string1,string2) Return Value: This function returns: 0 - if the two strings are equal value<0 - if string1 is less than string2 value>0 - if string1 is greater than string2 echo strcmp("Hello","Hello"); output= 0 equal echo strcmp("Hello","hELLo"); output=-32 as ASCII Code for H =71 and ASCII code for h = 104 result = 71-104=-32
1st Jul 2022, 11:30 PM
Aly Alsayed
Aly Alsayed - avatar
+ 2
Thank you Aly Alsayed
3rd Jul 2022, 9:24 AM
Juma Muyaka
Juma Muyaka - avatar
2nd Jul 2022, 3:40 PM
Oleh Davydenko
Oleh Davydenko - avatar