strncasecmp() function will compare two strings.
Note : Binary safe case-insensitive string comparison function.
[table caption=”” width=”100%” colwidth=”15%|15%|15%|55%” colalign=”left|left|left|left”]
Name, Required /Optional, Value Type, Description
string1, Required, String, It is the first string which will be compared.
string2, Required, String, It is the second string which will be compared.
length, Required, integer, It specifies the number of characters from each string to be used in the comparison.
[/table]
Return values in this function are:
<?php // case-insensitive comparison echo strncasecmp("Hi from tutorialmines.","hI FROM TUTORIALMINES.",10); ?>
Output of above code in the browser is as below:
<?php echo strncasecmp("Hi from tutorialmines.","hI FROM TUTORIALMINES."); echo "<br/>"; echo strncasecmp("Hi from tutorialmines.","hI from Tutorialmines."); ?>
Output of above code in the browser is as below:
App usage is growing steadily without showing any signs of slowing down. Hence, it is no surprise that mobile applications…
As the world has grown more digital, businesses have adapted themselves. An effectual adaptation includes online advertising. Offline advertising styles…
Step into a world where apps dance to the user's tune. Picture Instagram, a photo-sharing sensation that swept the globe.…
COVID-19 has led to a digitalization of lifestyle. As patients are taking their mental and physical health more seriously, healthcare…
Introduction WordPress, an immensely popular content management system (CMS), powers over 40% of the internet. What makes WordPress even more…
For moving companies trying to capture their market share amidst stiff competition, a tip or two about what they can…