cvs: phpdoc-zh /reference/url/functions get-meta-tags.xml http-build-query.xml
| From: | Krazy Nio | Date: | Tue, 11 Nov 2003 15:16:46 +0000 |
| Subject: | cvs: phpdoc-zh /reference/url/functions get-meta-tags.xml http-build-query.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1769@lists.php.net to get a copy of this message | ||
nio Tue Nov 11 10:16:46 2003 EDT
Added files:
/phpdoc-zh/reference/url/functions get-meta-tags.xml
http-build-query.xml
Log:
Add files.
Index: phpdoc-zh/reference/url/functions/get-meta-tags.xml
+++ phpdoc-zh/reference/url/functions/get-meta-tags.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: nio $ -->
<!-- EN-Revision: 1.4 Maintainer: nio Status: ready -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.get-meta-tags">
<refnamediv>
<refname>get_meta_tags</refname>
<refpurpose>
´ÓÒ»¸öÎļþÖÐÌáÈ¡ËùÓÐµÄ meta ±êÇ© content
ÊôÐÔ£¬·µ»ØÒ»¸öÊý×é
</refpurpose>
</refnamediv>
<refsect1>
<title>ÃèÊö</title>
<methodsynopsis>
<type>array</type><methodname>get_meta_tags</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam
choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam>
</methodsynopsis>
<para>
´ò¿ª <parameter>filename</parameter> ÖðÐнâÎöÎļþÖеÄ
<meta> ±êÇ©¡£´Ë²ÎÊý¿ÉÒÔÊDZ¾µØÎļþÒ²¿ÉÒÔÊÇÒ»¸ö
<acronym>URL</acronym>¡£½âÎö¹¤×÷½«ÔÚ
<literal></head></literal> ´¦Í£Ö¹¡£
</para>
<para>
½« <parameter>use_include_path</parameter> ÉèÖÃΪ 1 ½«´Ùʹ
PHP ³¢ÊÔ°´ÕÕ <link linkend="ini.include-path">include_path</link>
±ê×¼°üº¬Â·¾¶ÖеÄÿ¸öÖ¸ÏòÈ¥´ò¿ªÎļþ¡£ÕâÖ»ÓÃÓÚ±¾µØÎļþ£¬²»ÊÊÓÃÓÚ
URL¡£
</para>
<para>
<example>
<title><function>get_meta_tags</function> ½âÎöЩʲô</title>
<programlisting role="html">
<![CDATA[
<meta name="author" content="name">
<meta name="keywords" content="php documentation">
<meta name="DESCRIPTION" content="a php manual">
<meta name="geo.position" content="49.33;-86.59">
</head> <!-- ½âÎö¹¤×÷ÔÚ´Ë´¦Í£Ö¹ -->
]]>
</programlisting>
</example>
£¨×¢Òâ»Ø³µ»»ÐÐ £ PHP
ʹÓÃÒ»¸ö±¾µØº¯ÊýÀ´½âÎöÊäÈ룬ËùÒÔ Mac
ÉϵÄÎļþ½«²»ÄÜÔÚ Unix ÉÏÕý³£¹¤×÷£©¡£
</para>
<para>
·µ»ØµÄ¹ØÁªÊý×éÒÔÊôÐÔ name µÄÖµ×÷Ϊ¼ü£¬ÊôÐÔ content
µÄÖµ×÷Ϊֵ£¬ËùÒÔÄã¿ÉÒÔºÜÈÝÒ×µØÊ¹Óñê×¼Êý×麯Êý±éÀú´Ë¹ØÁªÊý×é»ò·ÃÎÊij¸öÖµ¡£ÊôÐÔ
name
ÖеÄÌØÊâ×Ö·û½«Ê¹Óá®_¡¯Ìæ»»£¬¶øÆäËü×Ö·ûÔòת»»³ÉСд¡£Èç¹ûÓÐÁ½¸ö
meta ±êǩӵÓÐÏàͬµÄ name£¬ÔòÖ»·µ»Ø×îºó³öÏÖµÄÄÇÒ»¸ö¡£
</para>
<para>
<example>
<title><function>get_meta_tags</function> µÄ·µ»ØÖµ</title>
<programlisting role="php">
<![CDATA[
<?php
// ¼ÙÉèÉϱߵıêÇ©ÊÇÔÚ www.example.com ÖÐ
$tags = get_meta_tags('http://www.example.com/');
//
×¢ÒâËùÓеļü£¨key£©¾ùΪСд£¬¶ø¼üÖеġ®.¡¯Ôòת»»³ÉÁË¡®_¡¯¡£
print $tags['author']; // name
print $tags['keywords']; // php documentation
print $tags['description']; // a php manual
print $tags['geo_position']; // 49.33;-86.59
?>
]]>
</programlisting>
</example>
</para>
<note>
<para>
´Ó PHP 4.0.5 ¿ªÊ¼£¬<function>get_meta_tags</function>
Ö§³ÖûÓÐʹÓÃÒýºÅÀ¨ÆðÀ´µÄ HTML ÊôÐÔ¡£
</para>
</note>
<para>
²Î¼û <function>htmlentities</function> ºÍ
<function>urlencode</function>¡£
</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:"../../../../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
-->
Index: phpdoc-zh/reference/url/functions/http-build-query.xml
+++ phpdoc-zh/reference/url/functions/http-build-query.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: nio $ -->
<!-- EN-Revision: 1.0 Maintainer: nio Status: ready -->
<refentry id="function.http-build-query">
<refnamediv>
<refname>http_build_query</refname>
<refpurpose>Éú³É url-encoded Ö®ºóµÄÇëÇó×Ö·û´®</refpurpose>
</refnamediv>
<refsect1>
<title>ÃèÊö</title>
<methodsynopsis>
<type>string</type><methodname>http_build_query</methodname>
<methodparam><type>array</type><parameter>formdata</parameter></methodparam>
<methodparam
choice="opt"><type>string</type><parameter>numeric_prefix</parameter></methodparam>
</methodsynopsis>
<simpara>
ʹÓøø³öµÄ¹ØÁª£¨»òϱ꣩Êý×éÉú³ÉÒ»¸ö
url-encoded ÇëÇó×Ö·û´®¡£²ÎÊý
<parameter>formdata</parameter>
¿ÉÒÔÊÇÊý×é»ò°üº¬ÊôÐԵĶÔÏó¡£Ò»¸ö
<parameter>formdata</parameter>
Êý×é¿ÉÒÔÊǼòµ¥µÄһά½á¹¹£¬Ò²¿ÉÒÔÊÇÓÉÊý×é×é³ÉµÄÊý×飨ÆäÒÀ´Î¿ÉÒÔ°üº¬ÆäËüÊý×飩¡£Èç¹ûÔÚ»ù´¡Êý×éÖÐʹÓÃÁËÊý×Öϱêͬʱ¸ø³öÁË
<parameter>numeric_prefix</parameter>
²ÎÊý£¬´Ë²ÎÊýÖµ½«»á×÷Ϊ»ù´¡Êý×éÖеÄÊý×ÖϱêÔªËØµÄǰ׺¡£ÕâÊÇΪÁËÈÃ
<literal>PHP</literal> »òÆäËü CGI
³ÌÐòÔÚÉÔºó¶ÔÊý¾Ý½øÐнâÂëʱ»ñÈ¡ºÏ·¨µÄ±äÁ¿Ãû¡£
</simpara>
<example>
<title><function>http_build_query</function> ʹÓÃʾÀý</title>
<programlisting role="php">
<![CDATA[
<?php
$data = array('foo'=>'bar',
'baz'=>'boom',
'cow'=>'milk',
'php'=>'hypertext processor');
echo http_build_query($data);
/* Êä³ö£º
foo=bar&baz=boom&cow=milk&php=hypertext+processor
*/
?>
]]>
</programlisting>
</example>
<example>
<title><function>http_build_query</function>
ʹÓÃÊý×ÖϱêµÄÔªËØ</title>
<programlisting role="php">
<![CDATA[
<?php
$data = array('foo', 'bar', 'baz', 'boom', 'cow'
=> 'milk', 'php' =>'hypertext processor');
echo http_build_query($data);
/* Êä³ö£º
0=foo&1=bar&2=baz&3=boom&cow=milk&php=hypertext+processor
*/
echo http_build_query($data, 'myvar_');
/* Êä³ö£º
myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&cow=milk&php=hypertext+processor
*/
?>
]]>
</programlisting>
</example>
<example>
<title><function>http_build_query</function>
ʹÓø´ÔÓµÄÊý×é</title>
<programlisting role="php">
<![CDATA[
<?php
$data = array('user'=>array('name'=>'Bob Smith',
'age'=>47,
'sex'=>'M',
'dob'=>'5/12/1956'),
'pastimes'=>array('golf', 'opera', 'poker',
'rap'),
'children'=>array('bobby'=>array('age'=>12,
'sex'=>'M'),
'sally'=>array('age'=>8,
'sex'=>'F')),
'CEO');
echo http_build_query($data, 'flags_');
/* Êä³ö£º£¨ÎªÁ˿ɶÁÐÔ¶ÔÆä½øÐÐÁËÕÛÐУ©
user[name]=Bob+Smith&user[age]=47&user[sex]=M&user[dob]=5%1F12%1F1956&
pastimes[0]=golf&pastimes[1]=opera&pastimes[2]=poker&pastimes[3]=rap&
children[bobby][age]=12&children[bobby][sex]=M&children[sally][age]=8&
children[sally][sex]=F&flags_0=CEO
×¢Ò⣺ֻÓлù´¡Êý×éÖеÄÊý×ÖϱêÔªËØ¡°CEO¡±²Å»ñÈ¡ÁËǰ׺£¬ÆäËüÊý×ÖϱêÔªËØ£¨Èç
pastimes
ϵÄÔªËØ£©Ôò²»ÐèҪΪÁ˺Ϸ¨µÄ±äÁ¿Ãû¶ø¼ÓÉÏǰ׺¡£
*/
?>
]]>
</programlisting>
</example>
<example>
<title><function>http_build_query</function> ʹÓöÔÏó</title>
<programlisting role="php">
<![CDATA[
<?php
class myClass {
var $foo;
var $baz;
function myClass() {
$this->foo = 'bar';
$this->baz = 'boom';
}
}
$data = new myClass();
echo http_build_query($data);
/* Êä³ö£º
foo=bar&baz=boom
*/
?>
]]>
</programlisting>
</example>
<simpara>
²Î¼û£º<function>parse_str</function>¡¢<function>parse_url</function>¡¢<function>urlencode</function>
ºÍ <function>array_walk</function>
</simpara>
</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:"../../../../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
-->