1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-26 16:32:13 +01:00
Files
archived-doc-es/reference/strings/functions/strrchr.xml
Andrés García 65889d7a4a updated to the most recent version.
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@321969 c90b9560-bf6c-de11-be94-00142212c4b1
2012-01-09 21:19:55 +00:00

147 lines
3.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 9ffbd15a2ff1d7c576270c5177cf4312b3684000 Maintainer: jpberdejo Status: ready -->
<!-- Reviewed: no Maintainer: andresdzphp -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strrchr">
<refnamediv>
<refname>strrchr</refname>
<refpurpose>Encuentra la última aparición de un caracter en un string</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>strrchr</methodname>
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
<methodparam><type>mixed</type><parameter>needle</parameter></methodparam>
</methodsynopsis>
<para>
Esta función devuelve la porción de <parameter>haystack</parameter> la cual
comienza en la última aparición de <parameter>needle</parameter> y que va
hasta el final de <parameter>haystack</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>haystack</parameter></term>
<listitem>
<para>
El string en donde buscar
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>needle</parameter></term>
<listitem>
<para>
Si <parameter>needle</parameter> contiene más de un caracter,
sólo se utiliza el primero. Este comportamiento es diferente que el de
<function>strstr</function>.
</para>
<para>
Si <parameter>needle</parameter> no es un string, se convierte en
un entero y se aplica como el valor ordinal de un caracter.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Esta función devuelve la porción de string o &false; si
no se encuentra <parameter>needle</parameter>.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.3.0</entry>
<entry>
Ahora esta función es segura a nivel binario.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de <function>strrchr</function></title>
<programlisting role="php">
<![CDATA[
<?php
// obtiene el último directorio en $PATH
$dir = substr(strrchr($PATH, ":"), 1);
// obtiene todo lo que está después de la última nueva línea
$text = "Line 1\nLine 2\nLine 3";
$last = substr(strrchr($text, 10), 1 );
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.bin-safe;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>strstr</function></member>
<member><function>strrpos</function></member>
</simplelist>
</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
-->