mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-29 23:38:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@290998 c90b9560-bf6c-de11-be94-00142212c4b1
117 lines
2.9 KiB
XML
117 lines
2.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="splfileobject.fgetss" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SplFileObject::fgetss</refname>
|
|
<refpurpose>Gets line from file and strip HTML tags</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>string</type><methodname>SplFileObject::fgetss</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>allowable_tags</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Identical to <methodname>SplFileObject::fgets</methodname>, except that
|
|
<methodname>SplFileObject::fgetss</methodname> attempts to strip any HTML and PHP tags from
|
|
the text it reads.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>allowable_tags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
You can use the optional third parameter to specify tags which should
|
|
not be stripped.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns a string containing the next line of the file with HTML and PHP
|
|
code stripped, or &false; on error.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><methodname>SplFileObject::fgetss</methodname> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$str = <<<EOD
|
|
<html><body>
|
|
<p>Welcome! Today is the <?php echo(date('jS')); ?> of <?= date('F'); ?>.</p>
|
|
</body></html>
|
|
Text outside of the HTML block.
|
|
EOD;
|
|
file_put_contents("sample.php", $str);
|
|
|
|
$file = new SplFileObject("sample.php");
|
|
while (!$file->eof()) {
|
|
echo $file->fgetss();
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
|
|
Welcome! Today is the of .
|
|
|
|
Text outside of the HTML block.
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>fgetss</function></member>
|
|
<member><methodname>SplFileObject::fgets</methodname></member>
|
|
<member><methodname>SplFileObject::fgetc</methodname></member>
|
|
<member><methodname>SplFileObject::current</methodname></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
|
|
-->
|