mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 16:32:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@323221 c90b9560-bf6c-de11-be94-00142212c4b1
192 lines
4.8 KiB
XML
192 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 68c2090fe7d30f90af82ea73a4430671eafc7751 Maintainer: jpberdejo Status: ready -->
|
|
<!-- Reviewed: no Maintainer: andresdzphp -->
|
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.stristr">
|
|
<refnamediv>
|
|
<refname>stristr</refname>
|
|
<refpurpose><function>strstr</function> insensible a mayúsculas y minúsculas</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>stristr</methodname>
|
|
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>needle</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>before_needle</parameter><initializer>false</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Devuelve todo de <parameter>haystack</parameter> iniciando desde e incluyendo la primera
|
|
aparición de <parameter>needle</parameter> hasta el final.
|
|
</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> no es un string, se convierte a
|
|
un integer y se aplica como el valor ordinal de un caracter.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>before_needle</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Si es &true;, <function>stristr</function>
|
|
devuelve la parte del <parameter>haystack</parameter> anterior a la
|
|
primera aparición del <parameter>needle</parameter> (excluyendo el needle).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
<para>
|
|
<parameter>needle</parameter> y <parameter>haystack</parameter>
|
|
se examinan de una manera insensible a mayúsculas y minúsculas.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el substring coincidente. Si no se encuentra <parameter>needle</parameter>,
|
|
devuelve &false;.
|
|
</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>5.3.0</entry>
|
|
<entry>
|
|
Agregado el parámetro opcional <parameter>before_needle</parameter>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>4.3.0</entry>
|
|
<entry>
|
|
<function>stristr</function> se hizo seguro a nivel binario.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>stristr</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$email = 'USER@EXAMPLE.com';
|
|
echo stristr($email, 'e'); // salida ER@EXAMPLE.com
|
|
echo stristr($email, 'e', true); // A partir de PHP 5.3.0, salida US
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Probando si un string se encuentra o no</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$string = 'Hello World!';
|
|
if(stristr($string, 'earth') === FALSE) {
|
|
echo '"earth" not found in string';
|
|
}
|
|
// salida: "earth" not found in string
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Utilizando un needle no "string"</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$string = 'APPLE';
|
|
echo stristr($string, 97); // 97 = a minúscula
|
|
// salida: APPLE
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.bin-safe;
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>strstr</function></member>
|
|
<member><function>strrchr</function></member>
|
|
<member><function>stripos</function></member>
|
|
<member><function>strpbrk</function></member>
|
|
<member><function>preg_match</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
|
|
-->
|
|
|