<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Grátis &#187; Dicas</title>
	<atom:link href="http://www.phpgratis.com.br/category/dicas/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpgratis.com.br</link>
	<description>scripts e conteúdos gratuitos</description>
	<lastBuildDate>Mon, 02 Aug 2010 12:45:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>APRENDER PHP PARA INICIANTES</title>
		<link>http://www.phpgratis.com.br/dicas/aprender-php-para-iniciantes/</link>
		<comments>http://www.phpgratis.com.br/dicas/aprender-php-para-iniciantes/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 23:48:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dicas]]></category>

		<guid isPermaLink="false">http://www.phpgratis.com.br/?p=129</guid>
		<description><![CDATA[A cada dia se torna mais importante dominar alguma linguagem de programação para produzir e melhorar sites na Internet. Se existe um investimento grandioso que você pode fazer em você mesmo é aprender uma linguagem de programação como PHP. E você pode aprender PHP na Internet mesmo sem custos ou se preferir pode buscar soluções [...]]]></description>
			<content:encoded><![CDATA[<p>A cada dia se torna mais importante dominar alguma linguagem de programação para produzir e melhorar sites na Internet. Se existe um investimento grandioso que você pode fazer em você mesmo é aprender uma linguagem de programação como PHP.</p>
<p>E você pode aprender PHP na Internet mesmo sem custos ou se preferir pode buscar soluções pagas onde é possível encontrar material de melhor qualidade e mais didático como é o caso de livros sobre PHP, cursos de PHP e vídeo aulas de PHP.</p>
<p>Quem não está disposto a gastar um bom começo é baixar e ler as apostilas publicadas neste <a href="http://www.apostilando.com/sessao.php?cod=8" target="_blank">site aqui</a> que é especializado em apostilas de todos os tipos. Todas são apostilas que podem ser baixadas gratuitamente. Infelizmente nem todas são didáticas para um iniciante. Para quem não gosta de estudar e ler na frente do computador uma boa sugestão são os livros. Com menos de R$ 50,00 você pode comprar um livro com qualidade superior aos tutoriais, <a href="http://compare.buscape.com.br/prod_unico?idu=1857608146&amp;estado=0&amp;cidade=0&amp;ordem=prec&amp;site_origem=4799584" target="_blank">veja um exemplo.</a> Outro bom livro pode <a href="http://compare.buscape.com.br/prod_unico?idu=1857452281&amp;estado=0&amp;cidade=0&amp;ordem=prec&amp;site_origem=4799584" target="_blank">ser este aqui.</a> Você também pode aprender PHP a partir do zero através do manual oficial do PHP que pode ser acessado em português <a href="http://www.phpgratis.com.br/manual-php/" target="_blank">clicando aqui.</a></p>
<p>Se você gosta de aprender através de vídeo aulas e já tem alguma experiência produzindo sites então uma boa sugestão de curso é o oferecido pelo webdesigner Bruno Ávila. Seu curso é direcionado ao iniciante de PHP e sua apresentação é toda através de vídeos. <a href="http://cursos.brunoavila.com.br/curso-php-para-web-designers.html" target="_blank">Veja aqui.</a> Para quem gosta de aprender através de fóruns uma boa dia é acompanhar as aulas para iniciantes que começam <a href="http://forum.wmonline.com.br/index.php?showtopic=104421" target="_blank">neste artigo aqui.</a> Também existe um básico para começar do <a href="http://forum.wmonline.com.br/index.php?showtopic=106101" target="_blank">zero aqui</a></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/m711mKI54iI&#038;hl=pt-br&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/m711mKI54iI&#038;hl=pt-br&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<div id="crp_related"><ul><li><a href="http://www.phpgratis.com.br/seguranca/video-aula-login-e-senha-usando-cookie-em-php/" rel="bookmark" class="crp_title">Vídeo Aula &#8211; Login e senha usando Cookie em PHP</a></li><li><a href="http://www.phpgratis.com.br/iniciante/como-abrir-arquivo-com-php/" rel="bookmark" class="crp_title">COMO ABRIR ARQUIVO COM PHP</a></li><li><a href="http://www.phpgratis.com.br/dicas/acentuacao-em-formulario-flash-com-php/" rel="bookmark" class="crp_title">Acentuação em formulário Flash com PHP</a></li><li><a href="http://www.phpgratis.com.br/mysql/sql-para-nerds/" rel="bookmark" class="crp_title">SQL PARA NERDS</a></li><li><a href="http://www.phpgratis.com.br/tutorial/engenharia-de-software-para-aplicacoes-de-internet/" rel="bookmark" class="crp_title">Engenharia de Software para Aplicações de Internet</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpgratis.com.br/dicas/aprender-php-para-iniciantes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Formatação de números em PHP</title>
		<link>http://www.phpgratis.com.br/dicas/formatacao-de-numeros-em-php/</link>
		<comments>http://www.phpgratis.com.br/dicas/formatacao-de-numeros-em-php/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 00:07:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dicas]]></category>

		<guid isPermaLink="false">http://www.phpgratis.com.br/dicas/formatacao-de-numeros-em-php/</guid>
		<description><![CDATA[Formatação para número monetário (dinheiro) &#60;?php // Formatação para numero monetário $number = &#8220;1234567890000000&#8243;; $number=number_format($number,2,&#8217;,',&#8217;.'); echo $number; // resultado 1.234.567.890.000.000,00 ?&#62; Formatação para número inteiro com espaçamento a cada 3 casas &#60;?php // Formatação para numero inteiro com espaçamento a cada 3 casas $number = &#8220;1234567890000000&#8243;; $number=number_format($number,0,&#8217;.',chr(0xA0)); echo $number; // resultado 1 234 567 890 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Formatação para número monetário (dinheiro)</strong></p>
<blockquote><p>&lt;?php<br />
// Formatação para numero monetário<br />
$number = &#8220;1234567890000000&#8243;;<br />
$number=number_format($number,2,&#8217;,',&#8217;.');<br />
echo $number;<br />
// resultado 1.234.567.890.000.000,00<br />
?&gt;</p></blockquote>
<p><strong>Formatação para número inteiro com espaçamento a cada 3 casas</strong></p>
<blockquote><p>&lt;?php<br />
// Formatação para numero inteiro com espaçamento a cada 3 casas<br />
$number = &#8220;1234567890000000&#8243;;<br />
$number=number_format($number,0,&#8217;.',chr(0xA0));<br />
echo $number;<br />
// resultado 1 234 567 890 000 000<br />
?&gt;</p></blockquote>
<p><strong>Formatação para número em reais com decimal 99</strong></p>
<blockquote><p>&lt;?php<br />
// Formatação para numero em reais com decimal 99<br />
$number = &#8220;2229346.99&#8243;;<br />
echo &#8220;R$&#8221; .number_format($number, 2, &#8216;,&#8217;, &#8216;.&#8217;);<br />
// resultado R$2.229.346,99<br />
?&gt;</p></blockquote>
<p><strong>Formatação para número em reais com decimal 00</strong></p>
<blockquote><p>&lt;?php<br />
// Formatação para número em reais com decimal 00<br />
$number = &#8220;222934699&#8243;;<br />
echo &#8220;R$&#8221; .number_format($number, 2, &#8216;,&#8217;, &#8216;.&#8217;);<br />
// resultado R$222.934.699,00<br />
?&gt;</p></blockquote>
<p><strong>Formatação para número em reais sem decimal</strong></p>
<blockquote><p>&lt;?php<br />
// Formatação para número em reais sem decimal<br />
$number = &#8220;222934699&#8243;;<br />
echo &#8220;R$&#8221; .number_format($number, 0, &#8216;,&#8217;, &#8216;.&#8217;);<br />
// resultado R$222.934.699<br />
?&gt;</p></blockquote>
<p><strong>Formatação para número colocando virgula a cada 3 casas</strong></p>
<blockquote><p>&lt;?php<br />
// Colocando virgula a cada 3 casas, Recebendo o valor por parametro<br />
function formatar($input)<br />
{<br />
if(strlen($input)&lt;=3)<br />
{ return $input; }<br />
$length=substr($input,0,strlen($input)-3);<br />
$formatted_input = formatar($length).&#8221;,&#8221;.substr($input,-3);<br />
return $formatted_input;<br />
}<br />
// numero a ser passado por parametro<br />
$num = 1234567; // imprimindo o valor<br />
echo  formatar($num); // resultado 1,234,567<br />
?&gt;</p></blockquote>
<p><strong>Formatação para número colocando ponto a cada 3 casas</strong></p>
<blockquote><p>&lt;?php<br />
// Colocando ponto a cada 3 casas, Recebendo o valor por parametro<br />
function formatando($input)<br />
{<br />
if(strlen($input)&lt;=3)<br />
{ return $input; }<br />
$length=substr($input,0,strlen($input)-3);<br />
$formatted_input = formatando($length).&#8221;.&#8221;.substr($input,-3);<br />
return $formatted_input;<br />
}<br />
// numero a ser passado por parametro<br />
$num = 1234567;<br />
// imprimindo o valor<br />
echo  formatando($num);// resultado 1.234.567<br />
?&gt;</p></blockquote>
<div id="crp_related"><ul><li><a href="http://www.phpgratis.com.br/tutorial/tudo-sobre-classes-e-objetos-em-php/" rel="bookmark" class="crp_title">Tudo sobre Classes e Objetos em PHP</a></li><li><a href="http://www.phpgratis.com.br/estatisticas/script-php-que-mostra-usuarios-on-line/" rel="bookmark" class="crp_title">Script PHP que mostra usuários on-line</a></li><li><a href="http://www.phpgratis.com.br/funcoes/php-para-mostrar-texto-e-links-randomicos/" rel="bookmark" class="crp_title">PHP para mostrar texto e links randômicos</a></li><li><a href="http://www.phpgratis.com.br/funcoes/como-somar-datas-usando-php/" rel="bookmark" class="crp_title">Como somar datas usando PHP</a></li><li><a href="http://www.phpgratis.com.br/javascript/abrir-visualizar-impressao-usando-javascript/" rel="bookmark" class="crp_title">Abrir visualizar impressão usando javascript</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpgratis.com.br/dicas/formatacao-de-numeros-em-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Como descobrir o país de um número IP</title>
		<link>http://www.phpgratis.com.br/dicas/como-descobrir-o-pais-de-um-numero-ip/</link>
		<comments>http://www.phpgratis.com.br/dicas/como-descobrir-o-pais-de-um-numero-ip/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 20:13:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dicas]]></category>

		<guid isPermaLink="false">http://www.phpgratis.com.br/dicas/como-descobrir-o-pais-de-um-numero-ip/</guid>
		<description><![CDATA[Uma dica de como descobrir o país onde está o visitante do seu site através do número IP. Na maioria das vezes o código acerta o IP do usuário. ip = $_SERVER['REMOTE_ADDR']; $locale = @file("http://api.hostip.info/country.php?ip=".$ip); Gerador de senhas randomicasMostrar imagem ou banner randomicoBloquear IP no seu script PHPFunção PHP para verificar domínio de e-mailComo somar datas usando PHP]]></description>
			<content:encoded><![CDATA[<p>Uma dica de como descobrir o país onde está o visitante do seu site através do número IP. Na maioria das vezes o código acerta o IP do usuário.</p>
<blockquote><p><code><span style="color: #000000"><span style="color: #0000bb">ip </span><span style="color: #007700">= </span><span style="color: #0000bb">$_SERVER</span><span style="color: #007700">[</span><span style="color: #dd0000">'REMOTE_ADDR'</span><span style="color: #007700">];<br />
</span><span style="color: #0000bb">$locale </span><span style="color: #007700">= @</span><span style="color: #0000bb">file</span><span style="color: #007700">(</span><span style="color: #dd0000">"http://api.hostip.info/country.php?ip="</span><span style="color: #007700">.</span><span style="color: #0000bb">$ip</span><span style="color: #007700">);</span></span></code></p></blockquote>
<div id="crp_related"><ul><li><a href="http://www.phpgratis.com.br/codigos/gerador-de-senhas-randomicas/" rel="bookmark" class="crp_title">Gerador de senhas randomicas</a></li><li><a href="http://www.phpgratis.com.br/codigos/mostrar-imagem-ou-banner-randomico/" rel="bookmark" class="crp_title">Mostrar imagem ou banner randomico</a></li><li><a href="http://www.phpgratis.com.br/codigos/bloquear-ip-no-seu-script-php/" rel="bookmark" class="crp_title">Bloquear IP no seu script PHP</a></li><li><a href="http://www.phpgratis.com.br/funcoes/funcao-php-para-verificar-dominio-de-e-mail/" rel="bookmark" class="crp_title">Função PHP para verificar domínio de e-mail</a></li><li><a href="http://www.phpgratis.com.br/funcoes/como-somar-datas-usando-php/" rel="bookmark" class="crp_title">Como somar datas usando PHP</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpgratis.com.br/dicas/como-descobrir-o-pais-de-um-numero-ip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Imagens linkadas randômicas</title>
		<link>http://www.phpgratis.com.br/dicas/imagens-linkadas-randomicas/</link>
		<comments>http://www.phpgratis.com.br/dicas/imagens-linkadas-randomicas/#comments</comments>
		<pubDate>Fri, 18 May 2007 13:28:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dicas]]></category>

		<guid isPermaLink="false">http://www.phpgratis.com.br/dicas/imagens-linkadas-randomicas/</guid>
		<description><![CDATA[Aqui temos um código simples para exibir imagens (que podem ser banners) linkadas de forma aleatória. PLAIN TEXT PHP: &#60;?php /* Simple randomizer. Roger Johansson, http://www.456bereastreet.com/ */ echo '&#60;ul&#62;' . "\n"; $items = array&#40; &#160; &#160; 1 =&#62; array&#40; &#160; &#160; &#160; &#160; 'href' =&#62; 'url-1', &#160; &#160; &#160; &#160; 'title' =&#62; 'title-text-1', &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Aqui temos um código simples para exibir imagens (que podem ser banners) linkadas de forma aleatória.</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">Simple randomizer.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">Roger Johansson, http://www.456bereastreet.com/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;ul&gt;'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$items</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC66CC;color:#800000;">1</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'href'</span> =&gt; <span style="color:#FF0000;">'url-1'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'title'</span> =&gt; <span style="color:#FF0000;">'title-text-1'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'src'</span> =&gt; <span style="color:#FF0000;">'image-1.jpg'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'alt'</span> =&gt; <span style="color:#FF0000;">'alt-text-1'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC66CC;color:#800000;">2</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'href'</span> =&gt; <span style="color:#FF0000;">'url-2'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'title'</span> =&gt; <span style="color:#FF0000;">'title-text-2'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'src'</span> =&gt; <span style="color:#FF0000;">'image-2.jpg'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'alt'</span> =&gt; <span style="color:#FF0000;">'alt-text-2'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC66CC;color:#800000;">3</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'href'</span> =&gt; <span style="color:#FF0000;">'url-3'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'title'</span> =&gt; <span style="color:#FF0000;">'title-text-3'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'src'</span> =&gt; <span style="color:#FF0000;">'image-3.jpg'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'alt'</span> =&gt; <span style="color:#FF0000;">'alt-text-3'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC66CC;color:#800000;">4</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'href'</span> =&gt; <span style="color:#FF0000;">'url-4'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'title'</span> =&gt; <span style="color:#FF0000;">'title-text-4'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'src'</span> =&gt; <span style="color:#FF0000;">'image-4.jpg'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'alt'</span> =&gt; <span style="color:#FF0000;">'alt-text-4'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC66CC;color:#800000;">5</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'href'</span> =&gt; <span style="color:#FF0000;">'url-5'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'title'</span> =&gt; <span style="color:#FF0000;">'title-text-5'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'src'</span> =&gt; <span style="color:#FF0000;">'image-5.jpg'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'alt'</span> =&gt; <span style="color:#FF0000;">'alt-text-5'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$numberOfItems</span> = <span style="color:#CC66CC;color:#800000;">3</span>; <span style="color:#FF9933; font-style:italic;">// Change to the number of items you want</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$randItems</span> = <a href="http://www.php.net/array_rand"><span style="color:#000066;">array_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arrItems</span>, <span style="color:#0000FF;">$numberOfItems</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span> &lt;<span style="color:#0000FF;">$numberOfItems</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$item</span> = <span style="color:#0000FF;">$arrItems</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$randItems</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\t</span>"</span> . <span style="color:#FF0000;">'&lt;li class=&quot;r'</span> . <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> + <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&quot;&gt;&lt;a href=&quot;'</span> . <span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'href'</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#FF0000;">'&quot; title=&quot;'</span> . <span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'title'</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#FF0000;">'&quot;&gt;&lt;img src=&quot;'</span> . <span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'src'</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#FF0000;">'&quot; alt=&quot;'</span> . <span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'alt'</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#FF0000;">'&quot;&gt;&lt;/a&gt;&lt;/li&gt;'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;/ul&gt;'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div id="crp_related"><ul><li><a href="http://www.phpgratis.com.br/estatisticas/script-php-que-mostra-usuarios-on-line/" rel="bookmark" class="crp_title">Script PHP que mostra usuários on-line</a></li><li><a href="http://www.phpgratis.com.br/seguranca/video-aula-login-e-senha-usando-cookie-em-php/" rel="bookmark" class="crp_title">Vídeo Aula &#8211; Login e senha usando Cookie em PHP</a></li><li><a href="http://www.phpgratis.com.br/estatisticas/clickheat-mapa-de-cliques/" rel="bookmark" class="crp_title">ClickHeat &#8211; Mapa de cliques</a></li><li><a href="http://www.phpgratis.com.br/dicas/colorir-codigo-javascript-html-css-xml-php-perl/" rel="bookmark" class="crp_title">Colorir código javascript, html, css, xml, php, perl</a></li><li><a href="http://www.phpgratis.com.br/fotos/redimencionar-imagens-com-php/" rel="bookmark" class="crp_title">REDIMENCIONAR IMAGENS COM PHP</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpgratis.com.br/dicas/imagens-linkadas-randomicas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Melhores sites internacionais sobre PHP e Mysql</title>
		<link>http://www.phpgratis.com.br/dicas/melhores-sites-internacionais-sobre-php-e-mysql/</link>
		<comments>http://www.phpgratis.com.br/dicas/melhores-sites-internacionais-sobre-php-e-mysql/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 03:39:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dicas]]></category>

		<guid isPermaLink="false">http://www.phpgratis.com.br/dicas/melhores-sites-internacionais-sobre-php-e-mysql/</guid>
		<description><![CDATA[Segue aqui uma lista com sites que todo desenvolvedor de PHP/MYSQL deveria conhecer: Web-based Databases Using PHP (virtual workshop) PHP Anthology PHP.net Introductory Tutorial Keeping Navigation Current with PHP Resourceindex.com PHP Command Reference PHP and mySQL PHP and PostgreSQL Build your own Database Driven Website using PHP &#38; MySQL HTTP authentication Webmonkey's PHP/MySQL Tutorial PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Segue aqui uma lista com sites que todo desenvolvedor de PHP/MYSQL deveria conhecer:</p>
<ul class="list">
<li><a href="http://www.keithjbrown.co.uk/vworks/php/" target="new"> Web-based Databases Using PHP (virtual workshop) </a></li>
<li><a href="http://www.webreference.com/programming/phpanth1/index.html" target="new"> PHP Anthology </a></li>
<li><a href="http://php.net/" target="new"> PHP.net </a></li>
<li><a href="http://www.php.net/tut.php" target="new"> Introductory Tutorial </a></li>
<li><a href="http://www.alistapart.com/articles/keepingcurrent/" target="new"> Keeping Navigation Current with PHP </a></li>
<li><a href="http://php.resourceindex.com/Documentation/" target="new"> Resourceindex.com </a></li>
<li><a href="http://perl.about.com/library/phpCR/bl_index.htm#functional" target="new"> PHP Command Reference </a></li>
<li><a href="http://www.webmasterbase.com/article.php?aid=228&amp;pid=0" target="new"> PHP and mySQL </a></li>
<li><a href="http://www.devshed.com/Server_Side/PHP/PostgreSQL/page1.html" target="new"> PHP and PostgreSQL </a></li>
<li><a href="http://www.webmasterbase.com/article/528/1" target="new"> Build your own Database Driven Website using PHP &amp; MySQL </a></li>
<li><a href="http://www.php.net/manual/en/features.http-auth.php" target="new"> HTTP authentication </a></li>
<li><a href="http://hotwired.lycos.com/webmonkey/databases/tutorials/tutorial4.html" target="new"> Webmonkey's PHP/MySQL Tutorial </a></li>
<li><a href="http://www.webmasterbase.com/article/560" target="new"> PHP and XML: Parsing RSS 1.0 </a></li>
<li><a href="http://perl.about.com/gi/dynamic/offsite.htm?site=http%3A%2F%2Fwww.devshed.com%2FServer_Side%2FXML%2FXMLwithPHP%2FXMLwithPHP1" target="new"> Using PHP with XML (part 1) </a></li>
<li><a href="http://perl.about.com/gi/dynamic/offsite.htm?site=http%3A%2F%2Fwww.devshed.com%2FServer_Side%2FXML%2FXMLwithPHP%2FXMLwithPHP2" target="new"> Using PHP with XML (part 2) </a></li>
<li><a href="http://zend.com/" target="new"> Zend </a></li>
<li><a href="http://www.hotscripts.com/PHP/" target="new"> HotScripts </a></li>
<li><a href="http://antriksh.com/resources/phpWizard.net" target="new"> phpWizard.net </a></li>
<li><a href="http://www.php.net/manual/en/ref.mcrypt.php" target="new"> Encryption function </a></li>
<li><a href="http://search.atomz.com/search/?sp-a=0002001d-sp00000000&amp;sp-q=PHP&amp;submit=-%3E%2Bgo%2B-%3E" target="new"> Webmonkey's PHP resources </a></li>
<li><a href="http://phphtmllib.sourceforge.net/index.php" target="new"> phpHtmlLib </a></li>
<li><a href="http://1callhosting.com/help/redirect_form_usingphp.html" target="new"> Re-Direct Form using PHP </a></li>
</ul>
<p>Mysql</p>
<ul>
<li><a href="http://dev.mysql.com/doc/mysql/en/index.html" target="new"> MySQL Manual </a></li>
<li><a href="http://www.mysql.com/" target="new"> mysql.com </a></li>
<li><a href="http://perl.about.com/b/a/092318.htm" target="new"> How to connecct to mySQL </a></li>
<li><a href="http://perl.about.com/od/phpandmysql/l/aa083003a.htm" target="new"> LOAD DATA in MySQL </a></li>
<li><a href="http://www.freewebmasterhelp.com/tutorials/phpmysql" target="new"> PHP/MySQL Tutorial </a></li>
<li><a href="http://www.webreference.com/programming/php/hierphp/" target="new"> A PHP -MySQL Interface for HierMenus 4 </a></li>
<li><a href="http://www.keithjbrown.co.uk/vworks/mysql/" target="new"> MySQL Databases and the SQL Language </a></li>
</ul>
<div id="crp_related"><ul><li><a href="http://www.phpgratis.com.br/mysql/gerenciador-de-base-de-dados-mysql-para-mac/" rel="bookmark" class="crp_title">Gerenciador de base de dados Mysql para Mac</a></li><li><a href="http://www.phpgratis.com.br/tutorial/video-tutorial-de-php-para-webdesigners/" rel="bookmark" class="crp_title">Video tutorial de php para webdesigners</a></li><li><a href="http://www.phpgratis.com.br/tutorial/como-instalar-php-e-mysql-no-windows/" rel="bookmark" class="crp_title">Como instalar PHP e Mysql no Windows</a></li><li><a href="http://www.phpgratis.com.br/ajax/acessar-dados-mysql-com-ajax/" rel="bookmark" class="crp_title">ACESSAR DADOS MYSQL COM AJAX</a></li><li><a href="http://www.phpgratis.com.br/formularios/formularios-trabalhando-com-mysql-de-forma-facil/" rel="bookmark" class="crp_title">Formulários trabalhando com Mysql de forma fácil</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpgratis.com.br/dicas/melhores-sites-internacionais-sobre-php-e-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colorir código javascript, html, css, xml, php, perl</title>
		<link>http://www.phpgratis.com.br/dicas/colorir-codigo-javascript-html-css-xml-php-perl/</link>
		<comments>http://www.phpgratis.com.br/dicas/colorir-codigo-javascript-html-css-xml-php-perl/#comments</comments>
		<pubDate>Sun, 15 Apr 2007 04:42:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dicas]]></category>

		<guid isPermaLink="false">http://www.phpgratis.com.br/dicas/colorir-codigo-javascript-html-css-xml-php-perl/</guid>
		<description><![CDATA[Utilizando este pacote que contém javascript e css você poderá colorir de forma automática todas as sintaxes de códigos: C , Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, Ruby, PHP e Perl que publicar no seu site. PLAIN TEXT JAVASCRIPT: &#60;link href="prettify.css" type="text/css" rel="stylesheet" /&#62; &#60;script src="prettify.js" type="text/javascript"&#62;&#60;/script&#62; Veja uma página com exemplos: http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html [...]]]></description>
			<content:encoded><![CDATA[<p>Utilizando este pacote que contém javascript e css você poderá colorir de forma automática todas as sintaxes de códigos: C ,     Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, Ruby, PHP e Perl que publicar no seu site.</p>
<div class="igBar"><span id="ljavascript-4"><a href="#" onclick="javascript:showPlainTxt('javascript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-4">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;link href=<span style="color: #3366CC;">"prettify.css"</span> type=<span style="color: #3366CC;">"text/css"</span> rel=<span style="color: #3366CC;">"stylesheet"</span> /&gt; &lt;script src=<span style="color: #3366CC;">"prettify.js"</span> type=<span style="color: #3366CC;">"text/javascript"</span>&gt;&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>Veja uma página com exemplos:<br />
<a href="http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html" target="_blank">http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html</a></p>
<p>Para copiar o script e CSS visite:<br />
<a href="http://google-code-prettify.googlecode.com/svn/trunk/README.html" target="_blank">http://google-code-prettify.googlecode.com/svn/trunk/README.html</a></p>
<div id="crp_related"><ul><li><a href="http://www.phpgratis.com.br/blog/crie-seu-blog-com-lingua/" rel="bookmark" class="crp_title">Crie seu blog com Lingua</a></li><li><a href="http://www.phpgratis.com.br/javascript/abrir-visualizar-impressao-usando-javascript/" rel="bookmark" class="crp_title">Abrir visualizar impressão usando javascript</a></li><li><a href="http://www.phpgratis.com.br/editores/melhor-editor-php-on-line-para-download/" rel="bookmark" class="crp_title">Melhor Editor PHP on-line para download</a></li><li><a href="http://www.phpgratis.com.br/framework/programando-php-com-code-igniter/" rel="bookmark" class="crp_title">Programando PHP com Code Igniter</a></li><li><a href="http://www.phpgratis.com.br/estatisticas/clickheat-mapa-de-cliques/" rel="bookmark" class="crp_title">ClickHeat &#8211; Mapa de cliques</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpgratis.com.br/dicas/colorir-codigo-javascript-html-css-xml-php-perl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Acentuação em formulário Flash com PHP</title>
		<link>http://www.phpgratis.com.br/dicas/acentuacao-em-formulario-flash-com-php/</link>
		<comments>http://www.phpgratis.com.br/dicas/acentuacao-em-formulario-flash-com-php/#comments</comments>
		<pubDate>Sat, 10 Mar 2007 00:02:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dicas]]></category>

		<guid isPermaLink="false">http://www.phpgratis.com.br/dicas/acentuacao-em-formulario-flash-com-php/</guid>
		<description><![CDATA[Autor:  Michel Scoz Se você acompanha alguns fóruns na internet, revistas ou páginas relacionadas a Flash ou a linguagem Action Script em geral, você provavelmente deve ter observado que há muitas pessoas com dúvidas relacionadas a como resolver problemas de acentuação no Flash, seja ao abrir algum arquivo TXT, XML ou até mesmo quando você [...]]]></description>
			<content:encoded><![CDATA[<p><strong></p>
<h3><strong>Autor:</strong>                        Michel Scoz</h3>
<p></strong> Se você acompanha alguns fóruns na internet, revistas ou páginas relacionadas a Flash ou a linguagem Action Script em geral, você provavelmente deve ter observado que há muitas pessoas com dúvidas relacionadas a como resolver problemas de acentuação no Flash, seja ao abrir algum arquivo TXT, XML ou até mesmo quando você faz um formulário de contato para enviar os dados preenchidos por email e a pessoa recebe o email com caractéres estranhos, sem sentido ou legibilidade alguma. Quem nunca se deparou com um problema destes ao fazer um site em Flash? Aposto que quase todos que começam a desenvolver no Flash acabam passando por este tipo de problema, cedo ou tarde!</p>
<p>Para resolver este problema de acentuação, muitas pessoas utilizam, e indicam, o comando "System.useCodePage = true;". O que poucos sabem é que para este problema NÃO é solucionado desta forma no Flash! Você já deve ter ouvido aquela velha frase: "Não adianta tampar o sol com a peneira!", não deve? Esta frase se encaixa perfeitamente no nosso contexto.</p>
<p>Este artigo tem o propósito de trazer informações suficientes para que todos entendam de forma clara e simples, quando usar e quando não usar este comando para solucionar problemas de acentuação ou com idiomas estrangeiros.</p>
<p>---</p>
<p><strong>O que causa os erros de acentuação no Flash?</strong></p>
<p>A partir da versão 6.0, o Adobe Flash trouxe e tomou como padrão a codificação Unicode (UTF-8) para textos/dados. Qualquer usuário com a versão 6.0, ou superior, tem a possibilidade de visualizar textos em outras línguas, independente do sistema operacional (SO) rodando na máquina.</p>
<p>Esta codificação Unicode tem o propósito de fornecer um número para cada caractere existente, independente da plataforma, programa ou língua nativa do sistema em questão. Desta forma, evitasse os problemas com codificações diferentes que acontecem em função de cada língua possuir os seus próprios caracteres especiais, como o caso do da língua portuguesa por exemplo, que possuímos o acento agudo, acento grave, acento circunflexo, trema, etc.</p>
<p><!--QuoteBegin-->QUOTE</p>
<p><!--QuoteEBegin-->	        <strong>Dica:</strong><br />
O padrão que o Flash utiliza é UTF-8, é um dos tipos de codificação Unicode. Você pode ler sobre o assunto em www.unicode.org.<!--QuoteEnd--></p>
<p><!--QuoteEEnd--></p>
<p>Sendo assim, depois da adoção do Unicode como codificação padrão, a partir do momento que você faz o Flash ler um arquivo texto ou um XML, estes dados são lidos com a codificação UTF-8. O que acontece é que mandamos os dados codificados no formato nativo da nossa língua, que no caso da língua portuguesa é o padrão ISO-8859-1, e o Flash espera receber estes dados em outra codificação, causando assim uma incompatibilidade na leitura destas informações. Este é o motivo dos problemas da falta de acentuação e aparição de caracteres ilegíveis.</p>
<p>O mesmo problema ocorre quando você envia alguns dados do Flash, visto que o padrão dele serve tanto para o envio como para a leitura de dados. Isto faz com que formulários de contatos, por exemplo, também apareçam com caracteres estranhos nos e-mails na hora da leitura!</p>
<p>---</p>
<p><strong>Onde entra o "System.useCodePage" nessa história? Por que foi ele criado? Como funciona?</strong></p>
<p>O que a Macromedia (hoje Adobe) trouxe para o Flash, já visando este tipo de problema, foi o System.useCodePage. Na própria documentação do Flash, se você procurar no menu de Ajuda ou no liveDocs da Adobe, você vai ver que eles recomendam que se utilize o comando abaixo para resolver estes problemas de acentuação:<br />
System.useCodePage = true;</p>
<p>O motivo para “ativar” esta "opção", digamos assim, se restringe a resolver estes problemas de acentuação no envio dos dados de formulários para outra fonte, seja um PHP, ASP, CF ou outra linguagem, e realmente "resolve" nosso problema. Quando você utiliza este comando como indicado, o Flash utiliza a codificação padrão do sistema operacional do usuário que está acessando o site/swf. Assim sendo, se você mandou o Flash abrir um XML, ou carregar um texto que utiliza a codificação ISO-8859-1, o texto vai abrir corretamente para quem usa o Windows em português, por exemplo.</p>
<p>---</p>
<p><strong>Por que NÃO usar System.useCodePage = true; então?!</strong></p>
<p>O motivo para evitar-se o uso do System.useCodePage = true; é bem simples. O que acontece utilizando este comando, como citado anteriormente, é que ele faz com que o Flash utilize a codificação padrão do sistema operacional do usuário que está acessando o site/swf, mas isto nos traz um problema também. Se o usuário utilizasse o Windows em português, ou outro sistema operacional qualquer em outro idioma, de tal forma que este sistema operacional estivesse configurado com a codificação diferente do padrão aqui do Brasil, no caso, ISO-8859-1, já teríamos problemas!</p>
<p>Imagine a seguinte situação, você fez uma viajem para o Japão e necessita que um dos clientes que você está visitando preencha um formulário em seu site, ou aplicativo web para passar alguns dados de extrema importância para você. Seu site/aplicativo é feito em Flash e envia os dados para um PHP, que por sua vez irá enviar os dados para um determinado e-mail de sua empresa. Neste cenário, teremos o típico problema de se usar o comando em questão. Entenda o porquê...</p>
<p>No momento que esta pessoa está preenchendo o formulário, ela irá observar tudo como deveria, sem problema algum. Entretanto, no momento em que esta pessoa enviar os dados através do formulário do site, estes dados serão enviados utilizando o padrão configurado no sistema operacional deste usuário, visto que você "disse" para o Flash utilizar a codificação padrão do sistema do usuário através do System.useCodePage!</p>
<p>Quando você for receber e ler o e-mail na sua empresa, você notará que ele conterá vários caracteres diferentes e ilegíveis. Estes caracteres são caracteres que esta pessoa digitou e que fazem parte língua nativa dela, ou do sistema operacional caso a pessoa tenha configurado ou optado por usar outro padrão. É aqui que se caracteriza a incompatibilidade das codificações de textos/dados.</p>
<p>Em nossa situação imaginária, a pessoa que enviou os dados, enviou usando no padrão do sistema operacional, que no caso seria o "Shift-JIS", pois o idioma nativo da pessoa era o Japonês. Na hora de enviar os dados, não fizemos tratamento algum dos caracteres especiais do idioma, logo os erros de caracteres aconteceram.</p>
<p>É claro que nossa situação pode ser um pouco fora da realidade, mas trazendo para um contexto do dia-a-dia de quem desenvolve sites em Flash, é bem comum as pessoas utilizarem notebooks importados com o Windows em Inglês, onde o padrão é o "CP1252". Se um usuário enviou os dados no seu site usando o padrão do Brasil, e você tentar ler o e-mail no Windows em Inglês, você vai ter este problema de acentuação também. Entendeu porque o uso System.useCodePage não resolve 100% nosso problema?</p>
<p>---</p>
<p><strong>Como resolver de uma vez por todas este problema então?!</strong></p>
<p>Para resolver definitivamente o problema, se você ler atentamente o último parágrafo da documentação do Flash. Você vai saber o que fazer, mas caso não tenha lido, o parágrafo diz o seguinte:</p>
<p>"To ensure that users on all platforms can view external text files used in your SWF files, you should encode all external text files as Unicode and leave System.useCodepage set to false by default. This way, Flash Player 6 and later interprets the text as Unicode."</p>
<p>Isto quer dizer que, para garantir que TODAS as plataformas apresentem os textos e XMLs corretamente, você deve garantir que estes dados sejam fornecidos na codificação padrão do Flash, no caso, Unicode (UTF-8).</p>
<p>Para fazer isto com PHP é extremamente simples... basta utilizar duas funções nativas, o utf8_decode() e utf8_encode().</p>
<p>Imagine que você esteja fazendo o PHP gerar um XML para o Flash ler. Então você deve usar o utf8_encode() para que os dados sejam codificados em UTF-8, como no exemplo abaixo:<br />
print('&lt;mensagem&gt;' . utf8_encode($variavel_mensagem) . '&lt;/mensagem&gt;' );</p>
<p>Agora, se você precisa que o Flash envie os dados de um formulário para um e-mail ou para guardar em um banco de dados de tal forma que você tenha a possibilidade de ler e editar sem toda hora ter que codificar/decodificar, então você utilizaria o utf8_decode(), como o exemplo a seguir:<br />
$mensagem = '&lt;b&gt;Mensagem: &lt;/b&gt;' . utf8_decode($_POST['mensagem']) . "&lt;br&gt;";</p>
<p>Pronto, problema resolvido, sem maiores dores de cabeça<br />
Espero ter esclarecido este assunto, e que seja de grande utilidade para todos.</p>
<p>Até mais,</p>
<p>Michel Scoz<br />
michelscoz [at] gmail [dot] com</p>
<div id="crp_related"><ul><li><a href="http://www.phpgratis.com.br/formularios/formularios-trabalhando-com-mysql-de-forma-facil/" rel="bookmark" class="crp_title">Formulários trabalhando com Mysql de forma fácil</a></li><li><a href="http://www.phpgratis.com.br/uncategorized/copiar-saida-dos-na-area-de-transferencia-do-windows/" rel="bookmark" class="crp_title">Copiar saída DOS na área de transferência do Windows</a></li><li><a href="http://www.phpgratis.com.br/scripts/como-criar-site-de-jogos-online/" rel="bookmark" class="crp_title">COMO CRIAR SITE DE JOGOS ONLINE</a></li><li><a href="http://www.phpgratis.com.br/scripts/script-php-upload-de-arquivos/" rel="bookmark" class="crp_title">SCRIPT PHP UPLOAD DE ARQUIVOS</a></li><li><a href="http://www.phpgratis.com.br/tutorial/tudo-sobre-classes-e-objetos-em-php/" rel="bookmark" class="crp_title">Tudo sobre Classes e Objetos em PHP</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpgratis.com.br/dicas/acentuacao-em-formulario-flash-com-php/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->