-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathstripos.xml
More file actions
104 lines (96 loc) · 3.28 KB
/
stripos.xml
File metadata and controls
104 lines (96 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
<refentry xml:id="function.stripos" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>stripos</refname>
<refpurpose>
Trova la prima occorrenza in una stringa senza distinzione tra maiuscole e minuscole
</refpurpose>
</refnamediv>
<refsect1>
<title>Descrizione</title>
<methodsynopsis>
<type>int</type><methodname>stripos</methodname>
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
Restituisce la posizione numerica della prima occorrenza di
<parameter>needle</parameter> nella <type>stringa</type> <parameter>haystack</parameter>.
Differentemente da <function> strpos</function>,
<function>stripos</function> non distingue tra maiuscole e minuscole.
</para>
<para>
Occorre rilevare che <parameter>needle</parameter> può essere una stringa di uno o
più caratteri.
</para>
<para>
Se <parameter>needle</parameter> non viene trovato,
<function>stripos</function> restituirà <type>boolean</type> &false;.
</para>
&return.falseproblem;
<para>
<example>
<title>Esempi di uso di <function>stripos</function></title>
<programlisting role="php">
<![CDATA[
<?php
$findme = 'a';
$mystring1 = 'xyz';
$mystring2 = 'ABC';
$pos1 = stripos($mystring1, $findme);
$pos2 = stripos($mystring2, $findme);
// No, 'a' non è certamente in 'xyz'
if ($pos1 === false) {
echo "The string '$findme' was not found in the string '$mystring1'";
}
// Notate l'uso di ===. Semplicemente == non avrebbe funzionato come atteso
// perché la posizione di 'a' è nel carattere 0 (il primo).
if ($pos2 !== false) {
echo "We found '$findme' in '$mystring2' at position $pos2";
}
?>
]]>
</programlisting>
</example>
</para>
<para>
Se <parameter>needle</parameter> non è una stringa, sarà convertito
in un intero e utilizzato come valore ordinale di un carattere.
</para>
<para>
Il parametro opzionale <parameter>offset</parameter> permette di
indicare da quale carattere di <parameter>haystack</parameter> iniziare
la ricerca. La posizione restituita sarà relativa all'inizio di
<parameter>haystack</parameter>.
</para>
¬e.bin-safe;
<para>
Vedere anche <function>strpos</function>, <function>strrpos</function>,
<function>strrchr</function>, <function>substr</function>,
<function>stristr</function>, <function>strstr</function>,
<function>strripos</function> e <function>str_ireplace</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->