mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
fix missing translations
This commit is contained in:
@@ -356,12 +356,12 @@ Retorna o tamanho da string dada.
|
||||
</note>
|
||||
<para>
|
||||
Ao contribuir com notas, os usuários podem fornecer exemplos adicionais, ressalvas e
|
||||
esclarecimentos para outros leitores. Mas por favor, não informe bugs usando o
|
||||
esclarecimentos para outros leitores. Mas por favor, não informe problemas usando o
|
||||
sistema de anotações. Para mais detalhes, veja a seção intitulada <link
|
||||
linkend="about.notes">'Sobre as notas de usuários'</link>.
|
||||
</para>
|
||||
<para>
|
||||
Também é possível enviar pull requests para o
|
||||
Também é possível enviar requisições de correções para o
|
||||
<link xlink:href="&url.php.git.mirror;doc-en">repositório espelho Github da documentação</link>.
|
||||
</para>
|
||||
<para>
|
||||
@@ -399,9 +399,9 @@ Retorna o tamanho da string dada.
|
||||
para fazer algumas conversões e formatações.
|
||||
</para>
|
||||
<para>
|
||||
O manual PHP é gerado em várias linguagens e formatos, veja
|
||||
O manual PHP é gerado em vários idiomas e formatos, veja
|
||||
<link xlink:href="&url.php.docs;">&url.php.docs;</link> para maiores detalhes.
|
||||
O código fonte <acronym>XML</acronym> pode ser baixado do git e
|
||||
O código fonte <acronym>XML</acronym> pode ser baixado do Git e
|
||||
visualizado em <link xlink:href="&url.php.git.mirror;doc-en">&url.php.git.mirror;doc-en</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
@@ -410,17 +410,17 @@ Retorna o tamanho da string dada.
|
||||
<title>Traduções</title>
|
||||
<para>
|
||||
O manual do PHP está disponível não apenas em vários formatos, mas
|
||||
também em várias linguagens. O texto do
|
||||
manual é escrito primeiro em inglês, então grupos de pessoas ao redor
|
||||
também em vários idiomas. O texto do
|
||||
manual é escrito primeiro em inglês e então grupos de pessoas ao redor
|
||||
do mundo fazem as traduções para suas línguas nativas.
|
||||
Se a tradução para uma específica função ou capítulo ainda não foi
|
||||
Se a tradução para um capítulo ou para uma função específica ainda não foi
|
||||
feita, o sistema de compilação do manual utiliza
|
||||
a versão original em inglês.
|
||||
</para>
|
||||
<para>
|
||||
Pessoas envolvidas na tradução iniciam do código fonte <acronym>XML</acronym>
|
||||
Pessoas envolvidas na tradução iniciam com o código fonte <acronym>XML</acronym>
|
||||
disponível em <link xlink:href="&url.php.git.mirror;doc-en">&url.php.git.mirror;doc-en</link>
|
||||
e partir daí é feita tradução para sua língua mãe. Eles
|
||||
e partir daí é feita tradução para sua língua nativa. Eles
|
||||
<emphasis>não utilizam</emphasis> as versões geradas (como
|
||||
<acronym>HTML</acronym> ou texto plano) já que é o sistema de compilação do manual que
|
||||
cuida das conversões de <acronym>XML</acronym> para formatos mais
|
||||
@@ -434,12 +434,12 @@ Retorna o tamanho da string dada.
|
||||
xlink:href="mailto:&email.php.doc.subscribe;">&email.php.doc.subscribe;</link>.
|
||||
O endereço da lista de discussão é <literal>&email.php.doc;</literal>. Informe na
|
||||
mensagem o interesse em traduzir o manual e alguém irá responder com
|
||||
orientações sobre como avançar iniciando uma nova tradução de linguagem ou
|
||||
orientações sobre como avançar iniciando uma tradução para uma nova língua ou
|
||||
entrando em contato com o time de documentação da língua desejada.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Atualmente o manual está disponível, parcialmente ou não, em mais de 10 linguagens.
|
||||
Atualmente o manual está disponível, parcialmente ou não, em mais de 10 idiomas.
|
||||
</para>
|
||||
<para>
|
||||
Todos eles podem ser baixados aqui: <link xlink:href="&url.php.docs;">&url.php.docs;</link>.
|
||||
|
||||
@@ -99,7 +99,7 @@ int(1)
|
||||
<para>
|
||||
Tentar usar um valor de retorno de uma função void simplesmente é avaliado como
|
||||
&null;, sem alertas emitidos. A razão para isso é que alertas
|
||||
implicariam no uso de funções would implicate the use of funções genéricas de ordem superior.
|
||||
implicariam no uso de funções genéricas de ordem superior.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
|
||||
@@ -994,8 +994,8 @@ $array["key"];
|
||||
<listitem>
|
||||
<para>
|
||||
A diretiva <link linkend="ini.mbstring.func-overload">mbstring.func_overload</link> foi
|
||||
removida. The related <constant>MB_OVERLOAD_MAIL</constant>,
|
||||
as constantes <constant>MB_OVERLOAD_STRING</constant>, e <constant>MB_OVERLOAD_REGEX</constant>
|
||||
removida. As constantes relacionadas <constant>MB_OVERLOAD_MAIL</constant>,
|
||||
<constant>MB_OVERLOAD_STRING</constant>, e <constant>MB_OVERLOAD_REGEX</constant>
|
||||
também foram removidas. Finalmente, a <literal>"func_overload"</literal> e a
|
||||
<literal>"func_overload_list"</literal> entradas <function>mb_get_info</function> foram
|
||||
removidas.
|
||||
@@ -1008,7 +1008,7 @@ $array["key"];
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Vários aliases mbregex descontinuados foram removidos. Veja a seguinte
|
||||
Vários sinônimos mbregex descontinuados foram removidos. Veja a seguinte
|
||||
lista para quais funções devem ser usadas:
|
||||
</para>
|
||||
<para>
|
||||
@@ -1156,8 +1156,8 @@ $array["key"];
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
The default error handling mode has been changed from "silent" to "exceptions". See
|
||||
<link linkend="pdo.error-handling">Errors and error handling</link> for details.
|
||||
O modo padrão de manipulação de erro foi alterado de "silent" para "exceptions". Consulte
|
||||
<link linkend="pdo.error-handling">Erros e manipulação de erros</link> para detalhes.
|
||||
<!-- RFC: https://wiki.php.net/rfc/pdo_default_errmode -->
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -1179,9 +1179,9 @@ $array["key"];
|
||||
<title>PDO ODBC</title>
|
||||
|
||||
<para>
|
||||
The &php.ini; directive
|
||||
<link linkend="ini.pdo-odbc.db2-instance-name">pdo_odbc.db2_instance_name</link> foi
|
||||
removido.
|
||||
A diretiva
|
||||
<link linkend="ini.pdo-odbc.db2-instance-name">pdo_odbc.db2_instance_name</link> do &php.ini;
|
||||
foi removida.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
|
||||
12
faq/html.xml
12
faq/html.xml
@@ -306,13 +306,13 @@ variable = document.forms[0].elements['var[]'];
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (isset($_GET['width']) AND isset($_GET['height'])) {
|
||||
// output the geometry variables
|
||||
echo "Screen width is: ". $_GET['width'] ."<br />\n";
|
||||
echo "Screen height is: ". $_GET['height'] ."<br />\n";
|
||||
// exibe as variáveis da geometria
|
||||
echo "A largura da tela é: ". $_GET['width'] ."<br />\n";
|
||||
echo "A altura da tela é: ". $_GET['height'] ."<br />\n";
|
||||
} else {
|
||||
// pass the geometry variables
|
||||
// (preserve the original query string
|
||||
// -- post variables will need to handled differently)
|
||||
// passar as variáveis de geometria
|
||||
// (preserve a string de consulta original
|
||||
// -- variáveis POST precisam ser manipuladas de forma diferente)
|
||||
|
||||
echo "<script language='javascript'>\n";
|
||||
echo " location.href=\"{$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}"
|
||||
|
||||
@@ -21,25 +21,25 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$arr = array('one', 'two', 'three', 'four', 'stop', 'five');
|
||||
$arr = array('um', 'dois', 'três', 'quatro', 'pare', 'cinco');
|
||||
foreach ($arr as $val) {
|
||||
if ($val == 'stop') {
|
||||
break; /* You could also write 'break 1;' here. */
|
||||
if ($val == 'pare') {
|
||||
break; /* Pode-se também usar 'break 1;' aqui. */
|
||||
}
|
||||
echo "$val<br />\n";
|
||||
}
|
||||
|
||||
/* Using the optional argument. */
|
||||
/* Usando o argumento opcional. */
|
||||
|
||||
$i = 0;
|
||||
while (++$i) {
|
||||
switch ($i) {
|
||||
case 5:
|
||||
echo "At 5<br />\n";
|
||||
break 1; /* Exit only the switch. */
|
||||
echo "No 5<br />\n";
|
||||
break 1; /* Sai apenas do switch. */
|
||||
case 10:
|
||||
echo "At 10; quitting<br />\n";
|
||||
break 2; /* Exit the switch and the while. */
|
||||
echo "No 10; saindo<br />\n";
|
||||
break 2; /* Sai do switch e do while. */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ echo $date->format(DateTimeInterface::RFC2822), "\n";
|
||||
<?php
|
||||
$date = new DateTimeImmutable();
|
||||
|
||||
// prints something like: Wednesday the 19th
|
||||
// exibe algo como: Wednesday the 19th
|
||||
echo $date->format('l \t\h\e jS');
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -593,12 +593,12 @@ $maxValueLength = 2 + max(array_map('strlen', $strftimeValues));
|
||||
|
||||
// Reporta formatos conhecidos
|
||||
foreach ($strftimeValues as $format => $value) {
|
||||
echo "Known format : '{$format}' = ", str_pad("'{$value}'", $maxValueLength), " ( {$strftimeFormats[$format]} )\n";
|
||||
echo "Formato conhecido : '{$format}' = ", str_pad("'{$value}'", $maxValueLength), " ( {$strftimeFormats[$format]} )\n";
|
||||
}
|
||||
|
||||
// Reporta formatos desconhecidos
|
||||
foreach (array_diff_key($strftimeFormats, $strftimeValues) as $format => $description) {
|
||||
echo "Unknown format : '{$format}' ", str_pad(' ', $maxValueLength), ($description ? " ( {$description} )" : ''), "\n";
|
||||
echo "Formato desconhecido : '{$format}' ", str_pad(' ', $maxValueLength), ($description ? " ( {$description} )" : ''), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -607,59 +607,59 @@ foreach (array_diff_key($strftimeFormats, $strftimeValues) as $format => $descri
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Known format : 'A' = 'Friday' ( A full textual representation of the day )
|
||||
Known format : 'B' = 'December' ( Full month name, based on the locale )
|
||||
Known format : 'H' = '11' ( Two digit representation of the hour in 24-hour format )
|
||||
Known format : 'I' = '11' ( Two digit representation of the hour in 12-hour format )
|
||||
Known format : 'M' = '24' ( Two digit representation of the minute )
|
||||
Known format : 'S' = '44' ( Two digit representation of the second )
|
||||
Known format : 'U' = '48' ( Week number of the given year, starting with the first Sunday as the first week )
|
||||
Known format : 'W' = '48' ( A numeric representation of the week of the year, starting with the first Monday as the first week )
|
||||
Known format : 'X' = '11:24:44' ( Preferred time representation based on locale, without the date )
|
||||
Known format : 'Y' = '2010' ( Four digit representation for the year )
|
||||
Known format : 'Z' = 'GMT Standard Time' ( The time zone offset/abbreviation option NOT given by %z (depends on operating system) )
|
||||
Known format : 'a' = 'Fri' ( An abbreviated textual representation of the day )
|
||||
Known format : 'b' = 'Dec' ( Abbreviated month name, based on the locale )
|
||||
Known format : 'c' = '12/03/10 11:24:44' ( Preferred date and time stamp based on local )
|
||||
Known format : 'd' = '03' ( Two-digit day of the month (with leading zeros) )
|
||||
Known format : 'j' = '337' ( Day of the year, 3 digits with leading zeros )
|
||||
Known format : 'm' = '12' ( Two digit representation of the month )
|
||||
Known format : 'p' = 'AM' ( UPPER-CASE "AM" or "PM" based on the given time )
|
||||
Known format : 'w' = '5' ( Numeric representation of the day of the week )
|
||||
Known format : 'x' = '12/03/10' ( Preferred date representation based on locale, without the time )
|
||||
Known format : 'y' = '10' ( Two digit representation of the year )
|
||||
Known format : 'z' = 'GMT Standard Time' ( Either the time zone offset from UTC or the abbreviation (depends on operating system) )
|
||||
Known format : '%' = '%' ( A literal percentage character ("%") )
|
||||
Unknown format : 'C' ( Two digit representation of the century (year divided by 100, truncated to an integer) )
|
||||
Unknown format : 'D' ( Same as "%m/%d/%y" )
|
||||
Unknown format : 'E'
|
||||
Unknown format : 'F' ( Same as "%Y-%m-%d" )
|
||||
Unknown format : 'G' ( The full four-digit version of %g )
|
||||
Unknown format : 'J'
|
||||
Unknown format : 'K'
|
||||
Unknown format : 'L'
|
||||
Unknown format : 'N'
|
||||
Unknown format : 'O'
|
||||
Unknown format : 'P' ( lower-case "am" or "pm" based on the given time )
|
||||
Unknown format : 'Q'
|
||||
Unknown format : 'R' ( Same as "%H:%M" )
|
||||
Unknown format : 'T' ( Same as "%H:%M:%S" )
|
||||
Unknown format : 'V' ( ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week )
|
||||
Unknown format : 'e' ( Day of the month, with a space preceding single digits )
|
||||
Unknown format : 'f'
|
||||
Unknown format : 'g' ( Two digit representation of the year going by ISO-8601:1988 standards (see %V) )
|
||||
Unknown format : 'h' ( Abbreviated month name, based on the locale (an alias of %b) )
|
||||
Unknown format : 'i'
|
||||
Unknown format : 'k' ( Hour in 24-hour format, with a space preceding single digits )
|
||||
Unknown format : 'l' ( Hour in 12-hour format, with a space preceding single digits )
|
||||
Unknown format : 'n' ( A newline character ("\n") )
|
||||
Unknown format : 'o'
|
||||
Unknown format : 'q'
|
||||
Unknown format : 'r' ( Same as "%I:%M:%S %p" )
|
||||
Unknown format : 's' ( Unix Epoch Time timestamp )
|
||||
Unknown format : 't' ( A Tab character ("\t") )
|
||||
Unknown format : 'u' ( ISO-8601 numeric representation of the day of the week )
|
||||
Unknown format : 'v'
|
||||
Formato conhecido : 'A' = 'Friday' ( A full textual representation of the day )
|
||||
Formato conhecido : 'B' = 'December' ( Full month name, based on the locale )
|
||||
Formato conhecido : 'H' = '11' ( Two digit representation of the hour in 24-hour format )
|
||||
Formato conhecido : 'I' = '11' ( Two digit representation of the hour in 12-hour format )
|
||||
Formato conhecido : 'M' = '24' ( Two digit representation of the minute )
|
||||
Formato conhecido : 'S' = '44' ( Two digit representation of the second )
|
||||
Formato conhecido : 'U' = '48' ( Week number of the given year, starting with the first Sunday as the first week )
|
||||
Formato conhecido : 'W' = '48' ( A numeric representation of the week of the year, starting with the first Monday as the first week )
|
||||
Formato conhecido : 'X' = '11:24:44' ( Preferred time representation based on locale, without the date )
|
||||
Formato conhecido : 'Y' = '2010' ( Four digit representation for the year )
|
||||
Formato conhecido : 'Z' = 'GMT Standard Time' ( The time zone offset/abbreviation option NOT given by %z (depends on operating system) )
|
||||
Formato conhecido : 'a' = 'Fri' ( An abbreviated textual representation of the day )
|
||||
Formato conhecido : 'b' = 'Dec' ( Abbreviated month name, based on the locale )
|
||||
Formato conhecido : 'c' = '12/03/10 11:24:44' ( Preferred date and time stamp based on local )
|
||||
Formato conhecido : 'd' = '03' ( Two-digit day of the month (with leading zeros) )
|
||||
Formato conhecido : 'j' = '337' ( Day of the year, 3 digits with leading zeros )
|
||||
Formato conhecido : 'm' = '12' ( Two digit representation of the month )
|
||||
Formato conhecido : 'p' = 'AM' ( UPPER-CASE "AM" or "PM" based on the given time )
|
||||
Formato conhecido : 'w' = '5' ( Numeric representation of the day of the week )
|
||||
Formato conhecido : 'x' = '12/03/10' ( Preferred date representation based on locale, without the time )
|
||||
Formato conhecido : 'y' = '10' ( Two digit representation of the year )
|
||||
Formato conhecido : 'z' = 'GMT Standard Time' ( Either the time zone offset from UTC or the abbreviation (depends on operating system) )
|
||||
Formato conhecido : '%' = '%' ( A literal percentage character ("%") )
|
||||
Formato desconhecido : 'C' ( Two digit representation of the century (year divided by 100, truncated to an integer) )
|
||||
Formato desconhecido : 'D' ( Same as "%m/%d/%y" )
|
||||
Formato desconhecido : 'E'
|
||||
Formato desconhecido : 'F' ( Same as "%Y-%m-%d" )
|
||||
Formato desconhecido : 'G' ( The full four-digit version of %g )
|
||||
Formato desconhecido : 'J'
|
||||
Formato desconhecido : 'K'
|
||||
Formato desconhecido : 'L'
|
||||
Formato desconhecido : 'N'
|
||||
Formato desconhecido : 'O'
|
||||
Formato desconhecido : 'P' ( lower-case "am" or "pm" based on the given time )
|
||||
Formato desconhecido : 'Q'
|
||||
Formato desconhecido : 'R' ( Same as "%H:%M" )
|
||||
Formato desconhecido : 'T' ( Same as "%H:%M:%S" )
|
||||
Formato desconhecido : 'V' ( ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week )
|
||||
Formato desconhecido : 'e' ( Day of the month, with a space preceding single digits )
|
||||
Formato desconhecido : 'f'
|
||||
Formato desconhecido : 'g' ( Two digit representation of the year going by ISO-8601:1988 standards (see %V) )
|
||||
Formato desconhecido : 'h' ( Abbreviated month name, based on the locale (an alias of %b) )
|
||||
Formato desconhecido : 'i'
|
||||
Formato desconhecido : 'k' ( Hour in 24-hour format, with a space preceding single digits )
|
||||
Formato desconhecido : 'l' ( Hour in 12-hour format, with a space preceding single digits )
|
||||
Formato desconhecido : 'n' ( A newline character ("\n") )
|
||||
Formato desconhecido : 'o'
|
||||
Formato desconhecido : 'q'
|
||||
Formato desconhecido : 'r' ( Same as "%I:%M:%S %p" )
|
||||
Formato desconhecido : 's' ( Unix Epoch Time timestamp )
|
||||
Formato desconhecido : 't' ( A Tab character ("\t") )
|
||||
Formato desconhecido : 'u' ( ISO-8601 numeric representation of the day of the week )
|
||||
Formato desconhecido : 'v'
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
<?php
|
||||
|
||||
$orgdoc = new DOMDocument;
|
||||
$orgdoc->loadXML("<root><element><child>text in child</child></element></root>");
|
||||
$orgdoc->loadXML("<raiz><elemento><filho>texto no filho</filho></elemento></raiz>");
|
||||
|
||||
// O nó que queremos importar para um novo documento
|
||||
$node = $orgdoc->getElementsByTagName("element")->item(0);
|
||||
$node = $orgdoc->getElementsByTagName("elemento")->item(0);
|
||||
|
||||
|
||||
// Crie um novo documento
|
||||
@@ -82,17 +82,17 @@ $newdoc = new DOMDocument;
|
||||
$newdoc->formatOutput = true;
|
||||
|
||||
// Adicione alguma marcação
|
||||
$newdoc->loadXML("<root><someelement>text in some element</someelement></root>");
|
||||
$newdoc->loadXML("<raiz><algumelemento>texto em algum elemento</algumelemento></raiz>");
|
||||
|
||||
echo "The 'new document' before copying nodes into it:\n";
|
||||
echo "O 'novo documento' antes de copiar nós nele:\n";
|
||||
echo $newdoc->saveXML();
|
||||
|
||||
// Importe o nó, e todos os seus filhos, para o documento
|
||||
$node = $newdoc->importNode($node, true);
|
||||
// E então acrescente-o ao nó "<root>"
|
||||
// E então acrescente-o ao nó "<raiz>"
|
||||
$newdoc->documentElement->appendChild($node);
|
||||
|
||||
echo "\nThe 'new document' after copying the nodes into it:\n";
|
||||
echo "\nO 'novo documento' após copiar nós nele:\n";
|
||||
echo $newdoc->saveXML();
|
||||
?>
|
||||
]]>
|
||||
@@ -100,20 +100,20 @@ echo $newdoc->saveXML();
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
The 'new document' before copying nodes into it:
|
||||
O 'novo documento' antes de copiar nós nele:
|
||||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<someelement>text in some element</someelement>
|
||||
</root>
|
||||
<raiz>
|
||||
<algumelemento>texto em algum elemento</algumelemento>
|
||||
</raiz>
|
||||
|
||||
The 'new document' after copying the nodes into it:
|
||||
O 'novo documento' após copiar nós nele:
|
||||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<someelement>text in some element</someelement>
|
||||
<element>
|
||||
<child>text in child</child>
|
||||
</element>
|
||||
</root>
|
||||
<raiz>
|
||||
<algumelemento>texto em algum elemento</algumelemento>
|
||||
<elemento>
|
||||
<filho>texto no filho</filho>
|
||||
</elemento>
|
||||
</raiz>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -49,18 +49,18 @@ XML;
|
||||
// Cria uma nova instância de DOMDocument
|
||||
$dom = new DOMDocument;
|
||||
|
||||
// Load the XML
|
||||
// Carrega o XML
|
||||
$dom->loadXML($xml);
|
||||
|
||||
// Imprime a linha onde o elemento 'node' foi definido
|
||||
printf('The <node> tag is defined on line %d', $dom->getElementsByTagName('node')->item(0)->getLineNo());
|
||||
printf('A tag <node> está definida na linha %d', $dom->getElementsByTagName('node')->item(0)->getLineNo());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
The <node> tag is defined in line 3
|
||||
A tag <node> está definida na linha 3
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
$a = new \Ds\Queue([1, 2, 3]);
|
||||
$b = $a->copy();
|
||||
|
||||
// Updating the copy doesn't affect the original
|
||||
// Atualizar a cópia não afeta o original
|
||||
$b->push(4);
|
||||
|
||||
print_r($a);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
$a = new \Ds\Vector([1, 2, 3]);
|
||||
$b = $a->copy();
|
||||
|
||||
// Updating the copy doesn't affect the original
|
||||
// Atualizar a cópia não afeta o original
|
||||
$b->push(4);
|
||||
|
||||
print_r($a);
|
||||
|
||||
@@ -78,7 +78,7 @@ function my_grp_file_opened_callback($data, $result) {
|
||||
eio_grp_add($grp, $req);
|
||||
}
|
||||
|
||||
/* Função chamada quando the file is read */
|
||||
/* Função chamada quando o arquivo é lido */
|
||||
function my_grp_file_read_callback($data, $result) {
|
||||
global $my_file_fd, $grp;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
$tag = 'en_US';
|
||||
$r = enchant_broker_init();
|
||||
$bprovides = enchant_broker_describe($r);
|
||||
echo "Current broker provides the following backend(s):\n";
|
||||
echo "O broker atual fornece os seguintes backend(s):\n";
|
||||
print_r($bprovides);
|
||||
|
||||
$dicts = enchant_broker_list_dicts($r);
|
||||
@@ -18,12 +18,12 @@ print_r($dicts);
|
||||
if (enchant_broker_dict_exists($r,$tag)) {
|
||||
$d = enchant_broker_request_dict($r, $tag);
|
||||
$dprovides = enchant_dict_describe($d);
|
||||
echo "dictionary $tag provides:\n";
|
||||
echo "dicionário $tag fornece:\n";
|
||||
$wordcorrect = enchant_dict_check($d, "soong");
|
||||
print_r($dprovides);
|
||||
if (!$wordcorrect) {
|
||||
$suggs = enchant_dict_suggest($d, "soong");
|
||||
echo "Suggestions for 'soong':";
|
||||
echo "Sugestões para 'soong':";
|
||||
print_r($suggs);
|
||||
}
|
||||
enchant_broker_free_dict($d);
|
||||
|
||||
@@ -77,15 +77,15 @@
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Reading a PHP file line-by-line</title>
|
||||
<title>Lendo um arquivo PHP linha por linha</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$str = <<<EOD
|
||||
<html><body>
|
||||
<p>Welcome! Today is the <?php echo(date('jS')); ?> of <?= date('F'); ?>.</p>
|
||||
<p>Bem-vindo! Hoje é <?php echo(date('jS')); ?> de <?= date('F'); ?>.</p>
|
||||
</body></html>
|
||||
Text outside of the HTML block.
|
||||
Texto fora do bloco HTML.
|
||||
EOD;
|
||||
file_put_contents('sample.php', $str);
|
||||
|
||||
@@ -103,9 +103,9 @@ if ($handle) {
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Welcome! Today is the of .
|
||||
Bem-vindo! Hoje é de .
|
||||
|
||||
Text outside of the HTML block.
|
||||
Texto fora do bloco HTML.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -43,24 +43,24 @@
|
||||
<example><!-- {{{ -->
|
||||
<title>Exemplo de <function>GearmanWorker::setId</function></title>
|
||||
<para>
|
||||
Define um identificador para um trabalhador simples.
|
||||
Define um identificador para um trabalhador simples.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$worker= new GearmanWorker();
|
||||
$worker->setId('test');
|
||||
$worker->setId('teste');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Run the following command:
|
||||
Execute o seguinte comando:
|
||||
gearadmin --workers
|
||||
|
||||
Output:
|
||||
30 ::3a3a:3361:3361:3a33%976303667 - : test
|
||||
Resultado:
|
||||
30 ::3a3a:3361:3361:3a33%976303667 - : teste
|
||||
]]>
|
||||
</screen>
|
||||
</example><!-- }}} -->
|
||||
|
||||
@@ -19,20 +19,20 @@
|
||||
<?php
|
||||
|
||||
$memcache = new Memcache;
|
||||
$memcache->connect('localhost', 11211) or die ("Could not connect");
|
||||
$memcache->connect('localhost', 11211) or die ("Não foi possível conectar");
|
||||
|
||||
$version = $memcache->getVersion();
|
||||
echo "Server's version: ".$version."<br/>\n";
|
||||
echo "Versão do servidor: ".$version."<br/>\n";
|
||||
|
||||
$tmp_object = new stdClass;
|
||||
$tmp_object->str_attr = 'test';
|
||||
$tmp_object->int_attr = 123;
|
||||
|
||||
$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
|
||||
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";
|
||||
$memcache->set('key', $tmp_object, false, 10) or die ("Falha ao gravar dados no servidor");
|
||||
echo "Armazene dados no cache (dados irão expirar em 10 segundos)<br/>\n";
|
||||
|
||||
$get_result = $memcache->get('key');
|
||||
echo "Data from the cache:<br/>\n";
|
||||
echo "Dados do cache:<br/>\n";
|
||||
|
||||
var_dump($get_result);
|
||||
|
||||
|
||||
@@ -64,13 +64,13 @@
|
||||
<?php
|
||||
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
|
||||
if (!$result) {
|
||||
echo 'Could not run query: ' . mysql_error();
|
||||
echo 'Não foi possível executar a consulta: ' . mysql_error();
|
||||
exit;
|
||||
}
|
||||
$row = mysql_fetch_row($result);
|
||||
|
||||
echo $row[0]; // 42
|
||||
echo $row[1]; // the email value
|
||||
echo $row[1]; // o valor do campo email
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -56,12 +56,12 @@
|
||||
<?php
|
||||
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
|
||||
if (!$result) {
|
||||
echo 'Could not run query: ' . mysql_error();
|
||||
echo 'Não foi possível executar a consulta: ' . mysql_error();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Will get the length of the id field as specified in the database
|
||||
// schema.
|
||||
// Obtendo o comprimento do campo 'id' como especificado no
|
||||
// esquema do banco de dados.
|
||||
$length = mysql_field_len($result, 0);
|
||||
echo $length;
|
||||
?>
|
||||
|
||||
@@ -54,19 +54,19 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* The users table consists of three fields:
|
||||
/* A tabela users consiste em três campos:
|
||||
* user_id
|
||||
* username
|
||||
* password.
|
||||
*/
|
||||
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
|
||||
if (!$link) {
|
||||
die('Could not connect to MySQL server: ' . mysql_error());
|
||||
die('Não foi possível conectar ao servidor MySQL: ' . mysql_error());
|
||||
}
|
||||
$dbname = 'mydb';
|
||||
$db_selected = mysql_select_db($dbname, $link);
|
||||
if (!$db_selected) {
|
||||
die("Could not set $dbname: " . mysql_error());
|
||||
die("Não foi possível selecionar $dbname: " . mysql_error());
|
||||
}
|
||||
$res = mysql_query('select * from users', $link);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 65e697ff671608989432a6e6bf8ae8128b2be2c7 Maintainer: fernandoc Status: ready -->
|
||||
<!-- EN-Revision: 65e697ff671608989432a6e6bf8ae8128b2be2c7 Maintainer: leonardolara Status: ready -->
|
||||
<refentry xml:id="function.mysql-field-table" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>mysql_field_table</refname>
|
||||
@@ -10,7 +10,7 @@
|
||||
<warning>
|
||||
&mysql.alternative.note;
|
||||
<simplelist role="alternatives">
|
||||
<member><function>mysqli_fetch_field_direct</function> [table] or [orgtable]</member>
|
||||
<member><function>mysqli_fetch_field_direct</function> [table] ou [orgtable]</member>
|
||||
<member><methodname>PDOStatement::getColumnMeta</methodname> [table]</member>
|
||||
</simplelist>
|
||||
</warning>
|
||||
@@ -49,17 +49,17 @@
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Exemplo <function>mysql_field_table</function></title>
|
||||
<title>Exemplo de <function>mysql_field_table</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$query = "SELECT account.*, country.* FROM account, country WHERE country.name = 'Portugal' AND account.country_id = country.id";
|
||||
|
||||
// get the result from the DB
|
||||
// obtém resultado do banco de dados
|
||||
$result = mysql_query($query);
|
||||
|
||||
// Lists the table name and then the field name
|
||||
// Lista o nome da tabela e depois o nome do campo
|
||||
for ($i = 0; $i < mysql_num_fields($result); ++$i) {
|
||||
$table = mysql_field_table($result, $i);
|
||||
$field = mysql_field_name($result, $i);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 65e697ff671608989432a6e6bf8ae8128b2be2c7 Maintainer: fernandoc Status: ready -->
|
||||
<!-- EN-Revision: 65e697ff671608989432a6e6bf8ae8128b2be2c7 Maintainer: leonardolara Status: ready -->
|
||||
<refentry xml:id="function.mysql-field-type" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>mysql_field_type</refname>
|
||||
@@ -55,7 +55,7 @@
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Exemplo <function>mysql_field_type</function></title>
|
||||
<title>Exemplo de <function>mysql_field_type</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -65,8 +65,8 @@ $result = mysql_query("SELECT * FROM func");
|
||||
$fields = mysql_num_fields($result);
|
||||
$rows = mysql_num_rows($result);
|
||||
$table = mysql_field_table($result, 0);
|
||||
echo "Your '" . $table . "' table has " . $fields . " fields and " . $rows . " record(s)\n";
|
||||
echo "The table has the following fields:\n";
|
||||
echo "Sua tabela '" . $table . "' tem " . $fields . " campos e " . $rows . " registro(s)\n";
|
||||
echo "A tabela tem os seguintes campos:\n";
|
||||
for ($i=0; $i < $fields; $i++) {
|
||||
$type = mysql_field_type($result, $i);
|
||||
$name = mysql_field_name($result, $i);
|
||||
@@ -82,8 +82,8 @@ mysql_close();
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Your 'func' table has 4 fields and 1 record(s)
|
||||
The table has the following fields:
|
||||
Sua tabela 'func' tem 4 campos e 1 registro(s)
|
||||
A tabela tem os seguintes campos:
|
||||
string name 64 not_null primary_key binary
|
||||
int ret 1 not_null
|
||||
string dl 128 not_null
|
||||
|
||||
@@ -48,7 +48,7 @@ $schema = $session->getSchema("addressbook");
|
||||
$table = $schema->getTable("names");
|
||||
|
||||
if ($table->existsInDatabase()) {
|
||||
echo "Yes, this table still exists in the session's schema.";
|
||||
echo "Sim, esta tabela ainda existe no esquema da sessão.";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
@@ -56,7 +56,7 @@ if ($table->existsInDatabase()) {
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Yes, this table still exists in the session's schema.
|
||||
Sim, esta tabela ainda existe no esquema da sessão.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -136,7 +136,7 @@ if (!$c) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$c) { // The original error wasn't 28001, or the password change failed
|
||||
if (!$c) { // O erro original não era 28001, ou a alteração de senha falhou
|
||||
$m = oci_error();
|
||||
trigger_error('Não foi possível conectar ao banco de dados: '. $m['message'], E_USER_ERROR);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ $insert->execute(array('pear', 'yellow'));
|
||||
$sth = $dbh->prepare("SELECT name, colour FROM fruit");
|
||||
$sth->execute();
|
||||
|
||||
/* Group values by the first column */
|
||||
/* Agrupa valores pela primeira coluna */
|
||||
var_dump($sth->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP));
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<![CDATA[
|
||||
<?php
|
||||
/**
|
||||
* A simple counter
|
||||
* Um contador simples
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ function counter1()
|
||||
}
|
||||
|
||||
/**
|
||||
* Another simple counter
|
||||
* Outro contador simples
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -74,11 +74,11 @@ $counter2 = function()
|
||||
|
||||
function dumpReflectionFunction($func)
|
||||
{
|
||||
// Print out basic information
|
||||
// Exibe informação básica
|
||||
printf(
|
||||
"\n\n===> The %s function '%s'\n".
|
||||
" declared in %s\n".
|
||||
" lines %d to %d\n",
|
||||
"\n\n===> A função do tipo %s '%s'\n".
|
||||
" declarada em %s\n".
|
||||
" linhas %d a %d\n",
|
||||
$func->isInternal() ? 'internal' : 'user-defined',
|
||||
$func->getName(),
|
||||
$func->getFileName(),
|
||||
@@ -86,17 +86,17 @@ function dumpReflectionFunction($func)
|
||||
$func->getEndline()
|
||||
);
|
||||
|
||||
// Print documentation comment
|
||||
printf("---> Documentation:\n %s\n", var_export($func->getDocComment(), 1));
|
||||
// Exibe comentário de documentação documentation comment
|
||||
printf("---> Documentação:\n %s\n", var_export($func->getDocComment(), 1));
|
||||
|
||||
// Print static variables if existant
|
||||
// Exibe variáveis estáticas se existirem
|
||||
if ($statics = $func->getStaticVariables())
|
||||
{
|
||||
printf("---> Static variables: %s\n", var_export($statics, 1));
|
||||
printf("---> Variáveis estáticas: %s\n", var_export($statics, 1));
|
||||
}
|
||||
}
|
||||
|
||||
// Create an instance of the ReflectionFunction class
|
||||
// Cria uma instância da classe ReflectionFunction
|
||||
dumpReflectionFunction(new ReflectionFunction('counter1'));
|
||||
dumpReflectionFunction(new ReflectionFunction($counter2));
|
||||
?>
|
||||
@@ -105,26 +105,26 @@ dumpReflectionFunction(new ReflectionFunction($counter2));
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
===> The user-defined function 'counter1'
|
||||
declared in Z:\reflectcounter.php
|
||||
lines 7 to 11
|
||||
---> Documentation:
|
||||
===> A função do tipo user-defined 'counter1'
|
||||
declarada em Z:\reflectcounter.php
|
||||
linhas 7 a 11
|
||||
---> Documentação
|
||||
'/**
|
||||
* A simple counter
|
||||
* Um contador simples
|
||||
*
|
||||
* @return int
|
||||
*/'
|
||||
---> Static variables: array (
|
||||
---> Variáveis estáticas: array (
|
||||
'c' => 0,
|
||||
)
|
||||
|
||||
|
||||
===> The user-defined function '{closure}'
|
||||
declared in Z:\reflectcounter.php
|
||||
lines 18 to 23
|
||||
---> Documentation:
|
||||
===> A função do tipo user-defined '{closure}'
|
||||
declarada em Z:\reflectcounter.php
|
||||
linhas 18 a 23
|
||||
---> Documentação
|
||||
'/**
|
||||
* Another simple counter
|
||||
* Outro contador simples
|
||||
*
|
||||
* @return int
|
||||
*/'
|
||||
|
||||
@@ -99,12 +99,12 @@ class Counter
|
||||
// Cria uma instância da classe ReflectionMethod
|
||||
$method = new ReflectionMethod('Counter', 'increment');
|
||||
|
||||
// Imprime informações básicas
|
||||
// Exibe informações básicas
|
||||
printf(
|
||||
"===> The %s%s%s%s%s%s%s method '%s' (which is %s)\n" .
|
||||
" declared in %s\n" .
|
||||
" lines %d to %d\n" .
|
||||
" having the modifiers %d[%s]\n",
|
||||
"===> O método %s%s%s%s%s%s%s '%s' (que é %s)\n" .
|
||||
" declarado em %s\n" .
|
||||
" linhas %d a %d\n" .
|
||||
" tem os modificadores %d[%s]\n",
|
||||
$method->isInternal() ? 'internal' : 'user-defined',
|
||||
$method->isAbstract() ? ' abstract' : '',
|
||||
$method->isFinal() ? ' final' : '',
|
||||
@@ -113,7 +113,7 @@ printf(
|
||||
$method->isProtected() ? ' protected' : '',
|
||||
$method->isStatic() ? ' static' : '',
|
||||
$method->getName(),
|
||||
$method->isConstructor() ? 'the constructor' : 'a regular method',
|
||||
$method->isConstructor() ? 'o contrutor' : 'um método normal',
|
||||
$method->getFileName(),
|
||||
$method->getStartLine(),
|
||||
$method->getEndline(),
|
||||
@@ -121,16 +121,16 @@ printf(
|
||||
implode(' ', Reflection::getModifierNames($method->getModifiers()))
|
||||
);
|
||||
|
||||
// Imprime comentário da documentação
|
||||
printf("---> Documentation:\n %s\n", var_export($method->getDocComment(), true));
|
||||
// Exibe comentário da documentação
|
||||
printf("---> Documentação:\n %s\n", var_export($method->getDocComment(), true));
|
||||
|
||||
// Imprime variáveis estáticas se existirem
|
||||
// Exibe variáveis estáticas se existirem
|
||||
if ($statics= $method->getStaticVariables()) {
|
||||
printf("---> Static variables: %s\n", var_export($statics, true));
|
||||
printf("---> Variáveis estáticas: %s\n", var_export($statics, true));
|
||||
}
|
||||
|
||||
// Invoca o método
|
||||
printf("---> Invocation results in: ");
|
||||
printf("---> A chamada resulta em: ");
|
||||
var_dump($method->invoke(NULL));
|
||||
?>
|
||||
]]>
|
||||
@@ -138,11 +138,11 @@ var_dump($method->invoke(NULL));
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
===> The user-defined final public static method 'increment' (which is a regular method)
|
||||
declared in /Users/philip/cvs/phpdoc/test.php
|
||||
lines 14 to 17
|
||||
having the modifiers 261[final public static]
|
||||
---> Documentation:
|
||||
===> O método user-defined final public static 'increment' (que é um método normal)
|
||||
declarado em in /Users/philip/cvs/phpdoc/test.php
|
||||
linhas 14 a 17
|
||||
tem os modificadores 261[final public static]
|
||||
---> Documentação:
|
||||
'/**
|
||||
* Contador de incremento
|
||||
*
|
||||
@@ -151,7 +151,7 @@ var_dump($method->invoke(NULL));
|
||||
* @access public
|
||||
* @return int
|
||||
*/'
|
||||
---> Invocation results in: int(1)
|
||||
---> A chamada resulta em: int(1)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -81,7 +81,7 @@ $client = new SoapClient('http://example.com/webservice.php?wsdl');
|
||||
|
||||
$client->__setLocation('http://www.somethirdparty.com');
|
||||
|
||||
$old_location = $client->__setLocation(); // unsets the location option
|
||||
$old_location = $client->__setLocation(); // remove a definição da opção de localização
|
||||
|
||||
echo $old_location;
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ $large->addField('inventory', 300);
|
||||
$skus = [$small, $medium, $large];
|
||||
$product->addChildDocuments($skus);
|
||||
|
||||
// add the product document block to the index
|
||||
// adiciona o bloco de documento do produto ao índice
|
||||
$updateResponse = $client->addDocument(
|
||||
$product,
|
||||
true, // substitui se o documento existir
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
$iterator = new DirectoryIterator(dirname(__FILE__));
|
||||
|
||||
$iterator->next();
|
||||
echo $iterator->key(); //1
|
||||
echo $iterator->key(); // 1
|
||||
|
||||
$iterator->rewind(); //rewinding to the beginning
|
||||
echo $iterator->key(); //0
|
||||
$iterator->rewind(); // retocedendo até o início
|
||||
echo $iterator->key(); // 0
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -74,7 +74,7 @@ print_r(class_uses('bar'));
|
||||
|
||||
spl_autoload_register();
|
||||
|
||||
// use autoloading to load the 'not_loaded' class
|
||||
// usando autocarregametno para carregar a classe 'not_loaded'
|
||||
print_r(class_uses('not_loaded', true));
|
||||
|
||||
?>
|
||||
|
||||
@@ -46,9 +46,9 @@ $regexIterator = new RegexIterator($arrayIterator, '/^test/');
|
||||
$regexIterator->setFlags(RegexIterator::USE_KEY);
|
||||
|
||||
if ($regexIterator->getFlags() & RegexIterator::USE_KEY) {
|
||||
echo 'Filtering based on the array keys.';
|
||||
echo 'Filtragem baseada nas chaves dos arrays.';
|
||||
} else {
|
||||
echo 'Filtering based on the array values.';
|
||||
echo 'Filtragem baseada nos valores dos arrays.';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
@@ -56,7 +56,7 @@ if ($regexIterator->getFlags() & RegexIterator::USE_KEY) {
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Filtering based on the array keys.
|
||||
Filtragem baseada nas chaves dos arrays.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -46,13 +46,13 @@ $regexIterator = new RegexIterator($arrayIterator, '/^[a-z]+/', RegexIterator::G
|
||||
|
||||
$mode = $regexIterator->getMode();
|
||||
if ($mode & RegexIterator::GET_MATCH) {
|
||||
echo 'Getting the match for each item.';
|
||||
echo 'Obtendo a correspondência para cada item.';
|
||||
} elseif ($mode & RegexIterator::ALL_MATCHES) {
|
||||
echo 'Getting all matches for each item.';
|
||||
echo 'Obtendo todas as correspondências para cada item.';
|
||||
} elseif ($mode & RegexIterator::MATCH) {
|
||||
echo 'Getting each item if it matches.';
|
||||
echo 'Obtendo cada item se ele corresponder.';
|
||||
} elseif ($mode & RegexIterator::SPLIT) {
|
||||
echo 'Getting split pieces of each.';
|
||||
echo 'Obtendo partes separadas de cada um.';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
@@ -60,7 +60,7 @@ if ($mode & RegexIterator::GET_MATCH) {
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Getting the match for each item.
|
||||
Obtendo a correspondência para cada item.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -53,11 +53,11 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Create a class extending SplFileObject
|
||||
// Cria a classe estendendo SplFileObject
|
||||
class MyFoo extends SplFileObject {}
|
||||
|
||||
$info = new SplFileInfo(__FILE__);
|
||||
// Set the class to use
|
||||
// Define a classe a ser usada
|
||||
$info->setFileClass('MyFoo');
|
||||
var_dump($info->openFile());
|
||||
?>
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
<?php
|
||||
$str = <<<EOD
|
||||
<html><body>
|
||||
<p>Welcome! Today is the <?php echo(date('jS')); ?> of <?= date('F'); ?>.</p>
|
||||
<p>Bem-vindo! Hoje é o <?php echo(date('jS')); ?> de <?= date('F'); ?>.</p>
|
||||
</body></html>
|
||||
Text outside of the HTML block.
|
||||
Texto fora do bloco HTML.
|
||||
EOD;
|
||||
file_put_contents("sample.php", $str);
|
||||
|
||||
@@ -78,9 +78,9 @@ while (!$file->eof()) {
|
||||
<screen>
|
||||
<![CDATA[
|
||||
|
||||
Welcome! Today is the of .
|
||||
Bem-vindo! Hoje é o de .
|
||||
|
||||
Text outside of the HTML block.
|
||||
Texto fora do bloco HTML.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -53,39 +53,39 @@
|
||||
<![CDATA[
|
||||
<?php
|
||||
$serverName = "serverName\sqlexpress";
|
||||
$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password");
|
||||
$conn = sqlsrv_connect( $serverName, $connectionInfo);
|
||||
if( $conn === false ) {
|
||||
die( print_r( sqlsrv_errors(), true));
|
||||
$connectionInfo = array("Database"=>"dbName", "UID"=>"username", "PWD"=>"password");
|
||||
$conn = sqlsrv_connect($serverName, $connectionInfo);
|
||||
if ($conn === false) {
|
||||
die(print_r(sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
$sql = "SELECT Sales FROM Table_1";
|
||||
|
||||
$stmt = sqlsrv_prepare( $conn, $sql);
|
||||
$stmt = sqlsrv_prepare($conn, $sql);
|
||||
|
||||
if( $stmt === false ) {
|
||||
die( print_r( sqlsrv_errors(), true));
|
||||
if ($stmt === false) {
|
||||
die(print_r(sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
if( sqlsrv_execute( $stmt ) === false) {
|
||||
die( print_r( sqlsrv_errors(), true));
|
||||
if (sqlsrv_execute($stmt) === false) {
|
||||
die(print_r(sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
$salesTotal = 0;
|
||||
$count = 0;
|
||||
|
||||
while( ($row = sqlsrv_fetch_array( $stmt)) && $salesTotal <=100000)
|
||||
while (($row = sqlsrv_fetch_array($stmt)) && $salesTotal <=100000)
|
||||
{
|
||||
$qty = $row[0];
|
||||
$price = $row[1];
|
||||
$salesTotal += ( $price * $qty);
|
||||
$salesTotal += ($price * $qty);
|
||||
$count++;
|
||||
}
|
||||
|
||||
echo "$count sales accounted for the first $$salesTotal in revenue.<br />";
|
||||
|
||||
// Cancela os resultados pendentes. A declaração pode ser reutilizada.
|
||||
sqlsrv_cancel( $stmt);
|
||||
sqlsrv_cancel($stmt);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -67,10 +67,10 @@ HTML;
|
||||
$tidy = tidy_parse_string($html);
|
||||
$num = 0;
|
||||
|
||||
// the head tag
|
||||
// a tag 'head'
|
||||
var_dump($tidy->html()->child[0]->hasChildren());
|
||||
|
||||
// the php inside the head tag
|
||||
// o PHP dentro da tag 'head'
|
||||
var_dump($tidy->html()->child[0]->child[0]->hasChildren());
|
||||
|
||||
?>
|
||||
|
||||
@@ -67,10 +67,10 @@ HTML;
|
||||
$tidy = tidy_parse_string($html);
|
||||
$num = 0;
|
||||
|
||||
// the html tag
|
||||
// a tag 'html'
|
||||
var_dump($tidy->html()->hasSiblings());
|
||||
|
||||
// the head tag
|
||||
// a tag 'head'
|
||||
var_dump($tidy->html()->child[0]->hasSiblings());
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user