<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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/"
	>

<channel>
	<title>Silici0 :: Blog</title>
	<link>http://www.rafaelcunha.com</link>
	<description>Php, JS, JQuery, Ajax e +++</description>
	<pubDate>Thu, 08 May 2008 13:32:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>WordList em PHP para cracks</title>
		<link>http://www.rafaelcunha.com/2008/05/08/wordlist-em-php-para-cracks/</link>
		<comments>http://www.rafaelcunha.com/2008/05/08/wordlist-em-php-para-cracks/#comments</comments>
		<pubDate>Thu, 08 May 2008 13:32:54 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>php</category>

		<category>Hacker</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/05/08/wordlist-em-php-para-cracks/</guid>
		<description><![CDATA[Bom, pensando no script para brutal Force no gmail que postei fiquei pensando; como podemos gerar uma lista de palavras para que possamos testar o script ? Existem diversas wordlist generator por ae, porém precisamos uma em php que construa e teste; gerar um arquivo TXT é uma lastima, pois fica gigantesto, então nada de [...]]]></description>
			<content:encoded><![CDATA[<p>Bom, pensando no script para brutal Force no gmail que <a target="_blank" title="Brutal Force no Gmail" href="http://www.rafaelcunha.com/2007/09/10/hack-descobrindo-senhas-de-e-mail/">postei</a> fiquei pensando; como podemos gerar uma lista de palavras para que possamos testar o script ? Existem diversas wordlist generator por ae, porém precisamos uma em php que construa e teste; gerar um arquivo TXT é uma lastima, pois fica gigantesto, então nada de pegar pronto, o negocio é gerar na mão.<br />
Mas o que é esse tal de wordlist então ?<br />
Nós podemos chamar de dicionário de palavras, nesta lista terá as palavras inimaginarias e imaginarias para que ao tentar crackear uma conta teste cada palavra como senha, o ideal para está lista seria ter todos as possíveis palavras.</p>
<p>Exemplos:</p>
<p>a, aa, ab, ac, ad ... aaaa, aaab, aaac, aaad ...</p>
<p>Para que possamos testar 1 a 1 e ter certeza que iremos conseguir, mas todas as possibilidades é algo muito grandioso, por isso existem os dicionários de palavras ja prontos, como nosso amigo disponibiliza <a target="_blank" title="WordList em pt_br" href="http://www.gustavoroberto.blog.br/2008/01/07/wordlisttxt-em-pt_br/">aqui</a>.</p>
<p>Mas e se quisermos criar uma lista completa em php como fazermos ?</p>
<p>Primeiro vamos definir em uma array todos os caracteres que iremos disponibilizar para teste:</p>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showCodeTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<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:#0000FF;">$alfa</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"A"</span>, <span style="color:#FF0000;">"B"</span>, <span style="color:#FF0000;">"C"</span>, <span style="color:#FF0000;">"D"</span>, <span style="color:#FF0000;">"F"</span>, <span style="color:#FF0000;">"G"</span>, <span style="color:#FF0000;">"H"</span>, <span style="color:#FF0000;">"I"</span>, <span style="color:#FF0000;">"K"</span>, <span style="color:#FF0000;">"L"</span>, <span style="color:#FF0000;">"M"</span>, <span style="color:#FF0000;">"N"</span>, <span style="color:#FF0000;">"O"</span>, <span style="color:#FF0000;">"Q"</span>, <span style="color:#FF0000;">"R"</span>, <span style="color:#FF0000;">"S"</span>, <span style="color:#FF0000;">"T"</span>, <span style="color:#FF0000;">"V"</span>, <span style="color:#FF0000;">"X"</span>, <span style="color:#FF0000;">"Y"</span>, <span style="color:#FF0000;">"Z"</span><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:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$alfa</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$valor</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<a href="http://www.php.net/strtoupper"><span style="color:#000066;">strtoupper</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$valor</span><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;">&#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;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$alfa</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$valor</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;"><span style="color:#0000FF;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<a href="http://www.php.net/strtolower"><span style="color:#000066;">strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$valor</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:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<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:#CC66CC;color:#800000;">10</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-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;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#0000FF;">$i</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;"><span style="color:#0000FF;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'$'</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;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'%'</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;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'&amp;'</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;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'*'</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;">$passlist</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'#'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Então como podemos gerar todas as possíveis <strike>senhas</strike> palavras para 6 caracteres?</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showCodeTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<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:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$passlist</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$va0</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;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$passlist</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$va1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$passlist</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$va2</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;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$passlist</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$va3</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$passlist</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$va4</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;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$passlist</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$va5</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$passlist</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$va6</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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$va0</span>.<span style="color:#0000FF;">$va1</span>.<span style="color:#0000FF;">$va2</span>.<span style="color:#0000FF;">$va3</span>.<span style="color:#0000FF;">$va4</span>.<span style="color:#0000FF;">$va5</span>.<span style="color:#0000FF;">$va6</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:#006600; font-weight:bold;">&#125;</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;"><span style="color:#006600; font-weight:bold;">&#125;</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;"><span style="color:#006600; font-weight:bold;">&#125;</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;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Acho que deu para ter uma idéia, esse script é para fins de aprendizado!
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/05/08/wordlist-em-php-para-cracks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Orientação a Objetos php4 parte 2</title>
		<link>http://www.rafaelcunha.com/2008/04/17/orientacao-a-objetos-php4-parte-2/</link>
		<comments>http://www.rafaelcunha.com/2008/04/17/orientacao-a-objetos-php4-parte-2/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 13:53:23 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>php</category>

		<category>Tutorial</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/04/17/orientacao-a-objetos-php4-parte-2/</guid>
		<description><![CDATA[Bom, já sabemos como definir e estarciarmos uma Classe, correto ? Se você ainda não sabe da uma olhada na parte 1, se você já sabe, bom, continuaremos hoje
mostrando como usar essa classe instanciada, como chamar seu método e definir variaveis.
Para nós utilizarmos um método (função) de uma classe faremos o seguinte, primeiro definimos ela:
PLAIN [...]]]></description>
			<content:encoded><![CDATA[<p>Bom, já sabemos como definir e estarciarmos uma Classe, correto ? Se você ainda não sabe da uma olhada na <a title="OO php4" target="_blank" href="http://www.rafaelcunha.com/2008/04/01/orientacao-a-objetos-oo-php4/">parte 1</a>, se você já sabe, bom, continuaremos hoje</p>
<p>mostrando como usar essa classe instanciada, como chamar seu método e definir variaveis.</p>
<p>Para nós utilizarmos um método (função) de uma classe faremos o seguinte, primeiro definimos ela:</p>
<div class="igBar"><span id="lphp-9"><a href="#" onclick="javascript:showCodeTxt('php-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-9">
<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;">Class</span> MinhaClasse<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;</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:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$atributo1</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;">var</span> <span style="color:#0000FF;">$atributo2</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;</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;">function</span> metodo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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;">$this</span>-&gt;<span style="color:#0000FF;">$atributo1</span> = <span style="color:#FF0000;">"Ola, Mundo!"</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:#0000FF;">$atributo1</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Instaciamos ela:</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showCodeTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<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:#0000FF;">$Obj</span> = <span style="color:#000000; font-weight:bold;">new</span> MinhaClasse<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Então agora chamaremos (executaremos) o método metodo() do nosso objeto OBJ:</p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showCodeTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<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:#0000FF;">$Obj</span>-&gt;<span style="color:#006600;">metodo</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>veja o resultado e se divirta. Perceba que a chamada de um método é sempre $Obj->nome_do_método($variaveis);, no caso para atribuirmos valores a um atributo (variavél) dentro da nossa Classe utilizamos $this-> que é uma pseudo-variável que quer dizer 'eu' ou 'objeto atual' fazendo referência a o Objeto que ela está, outro exemplo da $this->.</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showCodeTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<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;">Class</span> MinhaClasse<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;</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:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$atributo1</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;">var</span> <span style="color:#0000FF;">$atributo2</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;</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;">function</span> metodo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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;">$this</span>-&gt;<span style="color:#006600;">atributo1</span> = <span style="color:#FF0000;">"Ola, Mundo!"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Chamarei um outro método dentro deste método;</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;">$this</span>-&gt;<span style="color:#006600;">metodo2</span><span style="color:#006600; font-weight:bold;">&#40;</span><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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$atributo1</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:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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:#000000; font-weight:bold;">function</span> metodo2<span style="color:#006600; font-weight:bold;">&#40;</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;</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;">$this</span>-&gt;<span style="color:#006600;">atributo1</span> = <span style="color:#FF0000;">"Ola, Mundo Seja bem vindo a classe MinhaClasse!"</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;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Acho que por hoje é só... Apartir disso ja da para começar a escrever funções em classes.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/04/17/orientacao-a-objetos-php4-parte-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Orientação a Objetos (OO) php4</title>
		<link>http://www.rafaelcunha.com/2008/04/01/orientacao-a-objetos-oo-php4/</link>
		<comments>http://www.rafaelcunha.com/2008/04/01/orientacao-a-objetos-oo-php4/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 16:52:01 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>php</category>

		<category>Tutorial</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/04/01/orientacao-a-objetos-oo-php4/</guid>
		<description><![CDATA[Estou presumindo que você pelo menos tenha os conceitos básicos de Orientação a Objetos para entender este tutorial, caso não tenha veja AQUI um pouco sobre, estou escrevendo do php4 para começarmos a aprender, vendo que no php5 é bem diferente, a idéia é que venha outros textos sobre Orientação a Objetos com dicas e [...]]]></description>
			<content:encoded><![CDATA[<p>Estou presumindo que você pelo menos tenha os conceitos básicos de Orientação a Objetos para entender este tutorial, caso não tenha veja <a target="_blank" title="Blog Etilico - Teoria em OO " href="http://blogetilico.wordpress.com/2007/03/30/introducao-a-orientacao-a-objetos-primeira-parte/">AQUI </a>um pouco sobre, estou escrevendo do php4 para começarmos a aprender, vendo que no php5 é bem diferente, a idéia é que venha outros textos sobre Orientação a Objetos com dicas e boas práticas na hora de codar.</p>
<p>Porque utilizar Objetos</p>
<p>Pois objetos são facilmente reutilizados nos códigos, você irá aumentar a Flexibilidade na hora de programar e aumentar a velocidade na manutenção dos seus scripts, terá ainda maior compatibilidade de compartilhar códigos com outros programadores (sejam eles da sua equipe ou amigos).<br />
Maior facilidade para extender o seu código e debugar ele, o que covenhamos as vezes é complicado!</p>
<p>Objetos e Classes</p>
<p>No PHP para ter um objeto nós devemos instacia-lo apartir de uma classe, digamos assim que devemos criar a Classe e depois então instaciar em um Objeto, presumindo que você tenha uma idéia do que é um método (função) e atributos (variáveis).</p>
<p>Para definirmos uma classe temos :</p>
<div class="igBar"><span id="lphp-15"><a href="#" onclick="javascript:showCodeTxt('php-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-15">
<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;">class</span> MinhaClasse<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;"><span style="color:#FF9933; font-style:italic;">// Atributos</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:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$atributo1</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;">var</span> <span style="color:#0000FF;">$atributo2</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Métodos</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:#000000; font-weight:bold;">function</span> metodo1<span style="color:#006600; font-weight:bold;">&#40;</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;"><span style="color:#FF9933; font-style:italic;">//Código de execução quando o método for chamado</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;">return</span> <span style="color:#0000FF;">$algumaCoisa</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;">&nbsp;</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;">function</span> metodo2<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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:#FF9933; font-style:italic;">//Código de execução quando o método for chamado</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;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para instanciarmos nossa Classe em Objeto fazemos :</p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showCodeTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<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:#0000FF;">$MeuObjeto</span> = <span style="color:#000000; font-weight:bold;">new</span> MinhaClasse<span style="color:#006600; font-weight:bold;">&#40;</span><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;</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:#FF9933; font-style:italic;">// Podemos instacia-lo quantas vezes for necessario</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;">$MeuObjeto1</span> = <span style="color:#000000; font-weight:bold;">new</span> MinhaClasse<span style="color:#006600; font-weight:bold;">&#40;</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:#0000FF;">$novoNome</span> = <span style="color:#000000; font-weight:bold;">new</span> MinhaClasse<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/04/01/orientacao-a-objetos-oo-php4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flickr PRO com depósito bancario</title>
		<link>http://www.rafaelcunha.com/2008/03/31/flickr-pro-com-deposito-bancario/</link>
		<comments>http://www.rafaelcunha.com/2008/03/31/flickr-pro-com-deposito-bancario/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 02:20:12 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>php</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/03/31/flickr-pro-com-deposito-bancario/</guid>
		<description><![CDATA[Ja tenho visto uma discução enorme sobre o Flickr ser somente pago com cartões de crédito e não com boleto bancário, gerando um descontentamento de um grande parte de seus usuários. Mas a alegria chegou, agora uma das possibilidades é o pagamento atraves de deposito, o que deve ter gerado uma fortuna para o Yahoo! [...]]]></description>
			<content:encoded><![CDATA[<p>Ja tenho visto uma discução enorme sobre o Flickr ser somente pago com cartões de crédito e não com boleto bancário, gerando um descontentamento de um grande parte de seus usuários. Mas a alegria chegou, agora uma das possibilidades é o pagamento atraves de deposito, o que deve ter gerado uma fortuna para o Yahoo! Flickr.</p>
<p>Eu sou um felizardo que pagou e obtive uma conta Flickr PRO, estou me divertindo muito enviando meus albuns de fotos para o Flickr; e o meu Script em php de fotos utilizando o <a target="_blank" title="phpFlickr" href="http://www.phpflickr.com.br">phpFlickr</a> está aumentando, criarei novas funções, paginações e entre outros está no plano.</p>
<p>Após o pagamento você deve esperar a confirmação para utilizar sua conta como PRO, no meu caso foi uma espera de 1/2 dias, gostei muito, apesar de ser depósito foi bastante ágil.</p>
<p>Confira minhas fotos no <a target="_blank" title="Meu album de fotos Flickr" href="http://www.flickr.com/photos/silici0/">Flickr</a> e também no meu <a target="_blank" title="Meu album de fotos" href="http://www.rafaelcunha.com/Album/">album de fotos</a>. = )
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/03/31/flickr-pro-com-deposito-bancario/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Utilize menos banda em seus sites</title>
		<link>http://www.rafaelcunha.com/2007/12/04/utilize-menos-banda-em-seus-sites/</link>
		<comments>http://www.rafaelcunha.com/2007/12/04/utilize-menos-banda-em-seus-sites/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 11:34:53 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>php</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2007/12/04/utilize-menos-banda-em-seus-sites/</guid>
		<description><![CDATA[Segue uma dica para seus sites porno, de como salvar banda de trafeco. Para isso basta adicionar as linhas abaixos no inicio dos arquivos php do site. Recomendo um include na parada né.  
PLAIN TEXT
PHP:




@ini_set&#40;’zlib.output_compression_level’, 1&#41;;


@ob_start&#40;’ob_gzhandler’&#41;; 






Isso vai dizer para o servidor automaticamente comprimir os arquivos antes de enviar para o browser cliente. Lembrando [...]]]></description>
			<content:encoded><![CDATA[<p>Segue uma dica para seus sites porno, de como salvar banda de trafeco. Para isso basta adicionar as linhas abaixos no inicio dos arquivos php do site. Recomendo um include na parada né. <img src='http://www.rafaelcunha.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showCodeTxt('php-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-18">
<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;">@<a href="http://www.php.net/ini_set"><span style="color:#000066;">ini_set</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>’zlib.output_compression_level’, <span style="color:#CC66CC;color:#800000;">1</span><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;">@<a href="http://www.php.net/ob_start"><span style="color:#000066;">ob_start</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>’<a href="http://www.php.net/ob_gzhandler"><span style="color:#000066;">ob_gzhandler</span></a>’<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Isso vai dizer para o servidor automaticamente comprimir os arquivos antes de enviar para o browser cliente. Lembrando também que pode gerar excesso de leitura do servidor, gerando uma lerdesa na resposta, o que dificilmente o cliente irá perceber.</p>
<p>Fonte: <a target="_blank" title="Salvando Banda" href="http://www.v-nessa.net/2007/11/18/a-simple-way-to-save-bandwidth-in-php">v-nessa.net</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2007/12/04/utilize-menos-banda-em-seus-sites/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IF de uma linha no PHP</title>
		<link>http://www.rafaelcunha.com/2007/10/10/if-de-uma-linha-no-php/</link>
		<comments>http://www.rafaelcunha.com/2007/10/10/if-de-uma-linha-no-php/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 15:50:12 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>Trabalho</category>

		<category>php</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2007/10/10/if-de-uma-linha-no-php/</guid>
		<description><![CDATA[Como é bastante comum no meio de uma concatenação em PHP, fecha a concatenação para fazer um IF então depois abre-se de novo, criando no meio do texto diversas linhas desnecessárias . Para esse problema temos o if de uma linha usada no meio da concatenação, vejamos primeiro como é a estrutura do IF:
PLAIN TEXT
PHP:




if&#40; [...]]]></description>
			<content:encoded><![CDATA[<p>Como é bastante comum no meio de uma concatenação em PHP, fecha a concatenação para fazer um IF então depois abre-se de novo, criando no meio do texto diversas linhas desnecessárias . Para esse problema temos o if de uma linha usada no meio da concatenação, vejamos primeiro como é a estrutura do IF:</p>
<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showCodeTxt('php-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-21">
<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:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$X</span> == <span style="color:#0000FF;">$Y</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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Ae'</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:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'não ae'</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
No caso imaginemos que ipotéticamente queremos fazer esse teste no meio de um texto ou uma string longa, não precisamos utilizar o mesmo if, podemos simplesmente concatena-lo ao texto, torando mais limpo e rápida a estrutura, assim:</p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showCodeTxt('php-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Texto longo ... na na na '</span>.<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$x</span> == <span style="color:#0000FF;">$Y</span> ? <span style="color:#FF0000;">'caso verdadeiro'</span> : <span style="color:#FF0000;">'caso negativo'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">' continua o texto'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Pronto no caso acima testamos se a variável X é igual a Y, se for verdadeiro ele concatena 'caso verdadeiro', caso não seja verdade ele concatena 'caso negativo'. Testem, usem a imaginação e chega desses códigos com zilhões de linhas sem necessidade. Vou colocando dicas aos poucos.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2007/10/10/if-de-uma-linha-no-php/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
