mirror of
https://github.com/php/doc-es.git
synced 2026-04-23 15:18:07 +02:00
2b5d30977d
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@334651 c90b9560-bf6c-de11-be94-00142212c4b1
147 lines
3.7 KiB
XML
147 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: e41aab5ecacf449e51179886c17f1d41735b0234 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.fgetss">
|
|
<refnamediv>
|
|
<refname>fgetss</refname>
|
|
<refpurpose>Obtiene un línea desde un puntero a un archivo y elimina las etiquetas HTML</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>fgetss</methodname>
|
|
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>allowable_tags</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Idéntica a <function>fgets</function>, excepto que
|
|
<function>fgetss</function> intenta eliminar cualesquiera bytes NULL, etiquetas HTML y PHP del
|
|
texto que lee.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>handle</parameter></term>
|
|
<listitem>
|
|
&fs.validfp.all;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>length</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Longitud de la información que va a ser recuperada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>allowable_tags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Puede usar el tercer parámetro opcional para especificar las etiquetas que no deberían
|
|
ser eliminadas.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve una cadena de hasta <parameter>length</parameter> - 1 bytes leídos desde
|
|
el archivo apuntado por <parameter>handle</parameter>, con todo el código HTML y PHP
|
|
eliminado.
|
|
</para>
|
|
<para>
|
|
Si se produjo un error devuelve &false;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
<para>
|
|
<example>
|
|
<title>Leer un archivo PHP línea a línea</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$cadena = <<<EOD
|
|
<html><body>
|
|
<p>¡Bienvenido! Hoy es el <?php echo(date('jS')); ?> de <?= date('F'); ?>.</p>
|
|
</body></html>
|
|
Texto fuera del bloque HTML.
|
|
EOD;
|
|
file_put_contents('ejemplo.php', $cadena);
|
|
|
|
$gestor = @fopen("ejemplo.php", "r");
|
|
if ($gestor) {
|
|
while (!feof($gestor)) {
|
|
$buffer = fgetss($gestor, 4096);
|
|
echo $buffer;
|
|
}
|
|
fclose($gestor);
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
¡Bienvenido! Hoy es el de .
|
|
|
|
Texto fuera del bloque HTML.
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.line-endings;
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>fgets</function></member>
|
|
<member><function>fopen</function></member>
|
|
<member><function>popen</function></member>
|
|
<member><function>fsockopen</function></member>
|
|
<member><function>strip_tags</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
|
|
-->
|