Added php tags (<?php ?>) to examples.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@129494 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2003-05-30 20:43:26 +00:00
parent 9fd7018715
commit d9fc90e266
10 changed files with 31 additions and 11 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.basename">
<refnamediv>
@ -30,9 +30,11 @@
<title><function>basename</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$path = "/home/httpd/html/index.php";
$file = basename ($path); // $file is set to "index.php"
$file = basename ($path,".php"); // $file is set to "index"
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.copy">
<refnamediv>
@ -20,9 +20,11 @@
<title><function>copy</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
if (!copy($file, $file.'.bak')) {
print ("failed to copy $file...<br>\n");
}
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.dirname">
<refnamediv>
@ -26,8 +26,10 @@
<title><function>dirname</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$path = "/etc/passwd";
$file = dirname ($path); // $file is set to "/etc"
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry id="function.fnmatch">
<refnamediv>
<refname>fnmatch</refname>
@ -31,9 +31,11 @@
</title>
<programlisting role="php">
<![CDATA[
<?php
if(fnmatch("*gr[ae]y", $color)) {
echo "some form of gray ...";
}
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.fscanf">
<refnamediv>
@ -34,13 +34,15 @@
<example>
<title><function>fscanf</function> Example</title>
<programlisting role="php">
<![CDATA[
<![CDATA[
<?php
$handle = fopen ("users.txt","r");
while ($userinfo = fscanf ($handle, "%s\t%s\t%s\n")) {
list ($name, $profession, $countrycode) = $userinfo;
//... do something with the values
}
fclose($handle);
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.39 -->
<refentry id="function.mkdir">
<refnamediv>
@ -36,7 +36,9 @@
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
mkdir ("/path/to/my/dir", 0700);
?>
]]>
</programlisting>
</informalexample>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.23 -->
<refentry id="function.realpath">
<refnamediv>
@ -28,7 +28,9 @@
<title><function>realpath</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$real_path = realpath ("../../index.php");
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.tempnam">
<refnamediv>
@ -36,6 +36,7 @@
<title><function>tempnam</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$tmpfname = tempnam ("/tmp", "FOO");
$handle = fopen($tmpfname, "w");
@ -45,6 +46,7 @@ fclose($handle);
// do here something
unlink($tmpfname);
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.32 -->
<refentry id="function.tmpfile">
<refnamediv>
@ -29,9 +29,11 @@
<title><function>tmpfile</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$temp = tmpfile();
fwrite($temp, "writing to tempfile");
fclose($temp); // this removes the file
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.touch">
<refnamediv>
@ -33,12 +33,14 @@
<title><function>touch</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
if (touch ($FileName)) {
print "$FileName modification time has been
changed to todays date and time";
} else {
print "Sorry Could Not change modification time of $FileName";
}
?>
]]>
</programlisting>
</example>