cosmetics and examples

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@158098 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Damien Seguy 2004-05-06 15:25:58 +00:00
parent 8214f416b1
commit be0a936d2e
8 changed files with 114 additions and 12 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.11 -->
<refentry id="function.get-declared-classes">
<refnamediv>
@ -35,6 +35,31 @@
the appendices.
</para>
</note>
<para>
<example>
<title><function>get_declared_classes</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
print_r(get_declared_classes());
?>
]]>
</programlisting>
<para>
This script will output something close to :
</para>
<screen>
<![CDATA[
Array
(
[0] => stdClass
[1] => __PHP_Incomplete_Class
[2] => Directory
)
]]>
</screen>
</example>
</para>
<simpara>
See also <function>class_exists</function>.
</simpara>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.1 -->
<refentry id="function.get-object-vars">
<refnamediv>
@ -21,8 +21,7 @@
In versions prior to PHP 4.2.0, if the variables declared in the class
of which the <parameter>obj</parameter> is an instance, have not been
assigned a value, those will not be returned in the array. In versions
after PHP 4.2.0, the key will be assigned with a <constant>NULL</constant>
value.
after PHP 4.2.0, the key will be assigned with a &null; value.
</para>
</note>
<para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.9 -->
<refentry id="function.method-exists">
<refnamediv>
@ -18,6 +18,27 @@
<parameter>method_name</parameter> has been defined for the given
<parameter>object</parameter>, &false; otherwise.
</para>
<para>
<example>
<title><function>method_exists</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$directory = new Directory('.');
var_dump(method_exists($directory,'read'));
?>
]]>
</programlisting>
<para>
This script will output :
</para>
<screen>
<![CDATA[
bool(true)
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<!-- splitted from ./en/functions/misc.xml, last change in rev 1.2 -->
<refentry id="function.get-browser">
<refnamediv>
@ -18,7 +18,7 @@
<function>get_browser</function> attempts to determine the
capabilities of the user's browser. This is done by looking up
the browser's information in the <filename>browscap.ini</filename>
file. By default, the value of <varname>HTTP_USER_AGENT</varname> is
file. By default, the value of <varname>$_SERVER["HTTP_USER_AGENT"]</varname> is
used; however, you can alter this (i.e., look up another browser's
info) by passing the optional
<parameter>user_agent</parameter> parameter to

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<!-- splitted from ./en/functions/misc.xml, last change in rev 1.22 -->
<refentry id="function.highlight-file">
<refnamediv>
@ -70,7 +70,7 @@
]]>
</programlisting>
<simpara>
And then make a file named "source" and put it in your
And then make a file named <filename>source</filename> and put it in your
web root directory.
</simpara>
<programlisting role="php">

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/misc.xml, last change in rev 1.22 -->
<refentry id="function.highlight-string">
<refnamediv>
@ -25,6 +25,29 @@
not set to &true; then <function>highlight_string</function> will
return &true; on success, &false; on failure.
</simpara>
<para>
<example>
<title><function>highlight_string</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
highlight_string('<?php phpinfo(); ?>');
?>
]]>
</programlisting>
<para>
This script will output:
<para>
<screen>
<![CDATA[
<code><font color="#000000">
<font color="#0000BB">&lt;?php phpinfo</font><font color="#007700">(); </font><font color="#0000BB">?&gt;</font>
</font>
</code>
]]>
</screen>
</example>
</para>
<note>
<simpara>
The <parameter>return</parameter> parameter became available in PHP

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/misc.xml, last change in rev 1.4 -->
<refentry id="function.pack">
<refnamediv>
@ -95,6 +95,10 @@ $binarydata = pack("nvc*", 0x1234, 0x5678, 65, 66);
integer value too large to be stored that way it is converted to a
<type>float</type> which often yields an undesired result.
</para>
<para>
See also
<function>unpack</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/misc.xml, last change in rev 1.14 -->
<refentry id="function.usleep">
<refnamediv>
@ -17,6 +17,36 @@
for the given number of <parameter>micro_seconds</parameter>. A
microsecond is one millionth of a second.
</simpara>
<para>
<example>
<title>Exemple avec <function>sleep</function></title>
<programlisting role="php">
<![CDATA[
<?php
// Current time
echo date('h:i:s') . "\n";
// wait for 2 secondes
usleep(2000000);
// back!
echo date('h:i:s') . "\n";
?>
]]>
</programlisting>
<para>
This script will output :
</para>
<screen>
<![CDATA[
11:13:28
11:13:30
]]>
</screen>
</example>
</para>
<note>
<simpara>
This function did not work on Windows systems until PHP 5.0.0