reference/strings/functions/strncasecmp.xml
9b68bf2b63200534e022bc65e800cae6c75abf26
9b68bf2b63200534e022bc65e800cae6c75abf26
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strncasecmp">
3
+
<refentry xml:id="function.strncasecmp" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>strncasecmp</refname>
6
6
<refpurpose>Binary safe case-insensitive string comparison of the first n characters</refpurpose>
...
...
@@ -10,9 +10,9 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>int</type><methodname>strncasecmp</methodname>
13
-
<methodparam><type>string</type><parameter>str1</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>str2</parameter></methodparam>
15
-
<methodparam><type>int</type><parameter>len</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>string1</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>string2</parameter></methodparam>
15
+
<methodparam><type>int</type><parameter>length</parameter></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
This function is similar to <function>strcasecmp</function>, with the
...
...
@@ -26,7 +26,7 @@
26
26
<para>
27
27
<variablelist>
28
28
<varlistentry>
29
-
<term><parameter>str1</parameter></term>
29
+
<term><parameter>string1</parameter></term>
30
30
<listitem>
31
31
<para>
32
32
The first string.
...
...
@@ -34,7 +34,7 @@
34
34
</listitem>
35
35
</varlistentry>
36
36
<varlistentry>
37
-
<term><parameter>str2</parameter></term>
37
+
<term><parameter>string2</parameter></term>
38
38
<listitem>
39
39
<para>
40
40
The second string.
...
...
@@ -42,7 +42,7 @@
42
42
</listitem>
43
43
</varlistentry>
44
44
<varlistentry>
45
-
<term><parameter>len</parameter></term>
45
+
<term><parameter>length</parameter></term>
46
46
<listitem>
47
47
<para>
48
48
The length of strings to be used in the comparison.
...
...
@@ -55,10 +55,44 @@
55
55
56
56
<refsect1 role="returnvalues">
57
57
&reftitle.returnvalues;
58
+
&strings.comparison.return;
59
+
</refsect1>
60
+
61
+
<refsect1 role="changelog">
62
+
&reftitle.changelog;
63
+
<informaltable>
64
+
<tgroup cols="2">
65
+
<thead>
66
+
<row>
67
+
<entry>&Version;</entry>
68
+
<entry>&Description;</entry>
69
+
</row>
70
+
</thead>
71
+
<tbody>
72
+
&standard.changelog.binary-safe-string-comparison;
73
+
</tbody>
74
+
</tgroup>
75
+
</informaltable>
76
+
</refsect1>
77
+
78
+
<refsect1 role="examples">
79
+
&reftitle.examples;
58
80
<para>
59
-
Returns < 0 if <parameter>str1</parameter> is less than
60
-
<parameter>str2</parameter>; > 0 if <parameter>str1</parameter> is
61
-
greater than <parameter>str2</parameter>, and 0 if they are equal.
81
+
<example>
82
+
<title><function>strncasecmp</function> example</title>
83
+
<programlisting role="php">
84
+
<![CDATA[
85
+
<?php
86
+
87
+
$var1 = 'Hello John';
88
+
$var2 = 'hello Doe';
89
+
if (strncasecmp($var1, $var2, 5) === 0) {
90
+
echo 'First 5 characters of $var1 and $var2 are equals in a case-insensitive string comparison';
91
+
}
92
+
?>
93
+
]]>
94
+
</programlisting>
95
+
</example>
62
96
</para>
63
97
</refsect1>
64
98
...
...
@@ -66,18 +100,17 @@
66
100
&reftitle.seealso;
67
101
<para>
68
102
<simplelist>
103
+
<member><function>strncmp</function></member>
69
104
<member><function>preg_match</function></member>
70
-
<member><function>strcmp</function></member>
105
+
<member><function>substr_compare</function></member>
71
106
<member><function>strcasecmp</function></member>
72
-
<member><function>substr</function></member>
73
107
<member><function>stristr</function></member>
74
-
<member><function>strstr</function></member>
108
+
<member><function>substr</function></member>
75
109
</simplelist>
76
110
</para>
77
111
</refsect1>
78
112
79
113
</refentry>
80
-
81
114
<!-- Keep this comment at the end of the file
82
115
Local variables:
83
116
mode: sgml
84
117