-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathstrrpos.xml
103 lines (100 loc) · 3.2 KB
/
strrpos.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.8 -->
<refentry xml:id="function.strrpos" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>strrpos</refname>
<refpurpose>
Trova la posizione dell'ultima occorrenza di un carattere in una stringa
</refpurpose>
</refnamediv>
<refsect1>
<title>Descrizione</title>
<methodsynopsis>
<type>int</type><methodname>strrpos</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 dell'ultima occorrenza di
<parameter>needle</parameter> nella stringa
<parameter>haystack</parameter>. Fare attenzione che <parameter>needle</parameter>,
in PHP 4, può essere solo un singolo carattere. Se si passa una stringa,
verrà utilizzato solo il primo
carattere.
</para>
<para>
Se <parameter>needle</parameter> non viene trovato, la funzione restituisce &false;.
</para>
<para>
Si può facilmente confondere i valori restituiti "per carattere alla
posizione 0" e per "carattere non trovato". Ecco come rilevare
la differenza:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
// in PHP 4.0b3 e successivi:
$pos = strrpos($mystring, "b");
if ($pos === false) { // note: three equal signs
// not found...
}
// nelle versioni precedenti alla 4.0b3:
$pos = strrpos($mystring, "b");
if (is_bool($pos) && !$pos) {
// not found...
}
?>
]]>
</programlisting>
</informalexample>
</para>
<para>
Se <parameter>needle</parameter> non è una stringa, viene convertito in
un intero, e usato come valore ordinale di un carattere.
</para>
<note>
<simpara>
Dal PHP 5.0.0 <parameter>offset</parameter> può
essere indicato per indicare di iniziare la ricerca nella stringa da una
posizione di caratteri arbitraria. Valori negativi fermeranno la ricerca ad un punto arbitrario
prima della fine della stringa.
</simpara>
</note>
<note>
<simpara>
Il parametro <parameter>needle</parameter> può essere una stringa di uno o più
caratteri a partire dal PHP 5.0.0.
</simpara>
</note>
<para>
Vedere anche: <function>strpos</function>,
<function>strripos</function>,
<function>strrchr</function>,
<function>substr</function>,
<function>stristr</function> e
<function>strstr</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
-->