1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-25 16:02:13 +01:00
Files
archived-doc-es/reference/chdb/examples.xml
Jesús Ruiz-Ayúcar Vázquez eb34dbb4e1 cambios menores 4
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@317741 c90b9560-bf6c-de11-be94-00142212c4b1
2011-10-05 01:20:35 +00:00

75 lines
1.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 8b6d169424ff189bb563ef4c3f35f8adff3f42c5 Maintainer: seros Status: ready -->
<chapter xml:id="chdb.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<example>
<title>Crear un archivo chdb</title>
<programlisting role="php">
<![CDATA[
<?php
$data = array(
'clave1' => 'valor1',
'clave2' => 'valor2',
// ...
);
chdb_create('data.chdb', $data);
?>
]]>
</programlisting>
<para>
El ejemplo de arriba generará un archivo chdb llamado
<literal>data.chdb</literal> que contiene los pares clave-valor definidos en
<varname>$data</varname>.
</para>
</example>
<example>
<title>Cargar y examinar un archivo chdb</title>
<programlisting role="php">
<![CDATA[
<?php
$chdb = new chdb('data.chdb');
$valor1 = $chdb->get('clave1');
$valor2 = $chdb->get('clave2');
echo $valor1, PHP_EOL;
echo $valor2, PHP_EOL;
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
valor1
valor2
]]>
</screen>
</example>
</chapter>
<!-- 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
-->