<?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>Ayuda con tus Tareas</title>
	<atom:link href="http://ayuda.fotopex.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ayuda.fotopex.com</link>
	<description>En forma fácil</description>
	<lastBuildDate>Thu, 02 Sep 2010 13:57:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Como Hacer Una Carta</title>
		<link>http://ayuda.fotopex.com/documentos/como-hacer-una-carta/</link>
		<comments>http://ayuda.fotopex.com/documentos/como-hacer-una-carta/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 23:46:40 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[Documentos]]></category>
		<category><![CDATA[carta]]></category>
		<category><![CDATA[ejemplo]]></category>
		<category><![CDATA[Formato]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=794</guid>
		<description><![CDATA[Paso 1 &#8211; Identificación del remitente Para una buena carta necesitamos especificar los datos del remitente y destinatario y es que el destinatario que abre la carta necesita saber rápidamente ¿QUIEN? envía la carta. Arriba a la derecha, de forma que sea lo primero que se lea, indicaremos nuestros datos, uno debajo de otro formando [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 5px; float: left; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p><strong> Paso 1 &#8211; Identificación del remitente</strong></p>
<p>Para una buena carta necesitamos especificar los datos del remitente y destinatario y es que el destinatario que abre la carta necesita saber rápidamente <strong>¿QUIEN?</strong> envía la carta.</p>
<p>Arriba a la derecha, de forma que sea lo primero que se lea, indicaremos nuestros datos, uno debajo de otro formando una pequeña columna.</p>
<p><strong>Nombre y apellidos.<br />
Nombre de nuestra empresa.<br />
Nuestro cargo en la empresa.</strong></p>
<p>En algunos casos se requiere indicar información complementaria como el número de oficio en caso de que existiera y el asunto a tratar.</p>
<p>Por ejemplo:</p>
<div style="clear:both;"></div>
<p><span id="more-794"></span></p>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="576" valign="top">
<p style="text-align: right;"><strong>KIKE GAVILAN</strong></p>
<p style="text-align: right;"><strong>FotoPex.com</strong></p>
<p style="text-align: right;"><strong>DEPARTAMENTO DE SISTEMAS</strong></p>
<p style="text-align: right;"><strong>OF/158892.</strong></p>
<p style="text-align: right;"><strong>Asunto: SOLICITUD DE PERSONAL</strong></p>
</td>
</tr>
</tbody>
</table>
<p><strong><br />
</strong></p>
<p><strong> </strong></p>
<p><strong> Paso 2 &#8211; Tiempo y lugar</strong></p>
<p>El destinatario una vez que conoce el <strong>QUIEN</strong>, quiere saber el <strong>DONDE </strong>y el <strong>CUANDO</strong>. Debemos dar a conocer el lugar desde el que se escribe y la fecha en la que se escribe.</p>
<p>Ejemplo:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="576" valign="top">
<p style="text-align: right;"><strong>KIKE GAVILAN</strong></p>
<p style="text-align: right;"><strong>FotoPex.com</strong></p>
<p style="text-align: right;"><strong>DEPARTAMENTO DE SISTEMAS</strong></p>
<p style="text-align: right;"><strong>OF/158892.</strong></p>
<p style="text-align: right;"><strong>Asunto: SOLICITUD DE PERSONAL</strong></p>
<p style="text-align: right;">Huajuapan de León, Oax, a 01 de Septiembre de1 2010</p>
</td>
</tr>
</tbody>
</table>
<p><strong> Paso 3 &#8211; Identificación del destinatario</strong></p>
<p>En un segundo párrafo, debajo de la fecha y a la izquierda, indicaremos la información del destinatario de la carta.</p>
<p><strong>Nombre del destinatario (si se conoce).<br />
Nombre de la empresa.<br />
Cargo que desempeña o departamento al que pertenece.</strong></p>
<p>Por ejemplo:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="576" valign="top">
<p style="text-align: right;"><strong>KIKE GAVILAN</strong></p>
<p style="text-align: right;"><strong>FotoPex.com</strong></p>
<p style="text-align: right;"><strong>DEPARTAMENTO DE SISTEMAS</strong></p>
<p style="text-align: right;"><strong>OF/158892.</strong></p>
<p style="text-align: right;"><strong>Asunto: SOLICITUD DE PERSONAL</strong></p>
<p style="text-align: right;">Huajuapan de León, Oax, a 01 de Septiembre de1 2010</p>
<p><strong>Lic. Omar Estrada</strong><br />
<strong>FotoPex.com</strong><br />
<strong>Departamento de R.H.</strong></td>
</tr>
</tbody>
</table>
<p><strong> Paso 4 &#8211; El párrafo del asunto</strong></p>
<p>Lo más recomendable es siempre ir directamente al punto que debemos tratar. Que en la primera frase se conozca el asunto de la carta.</p>
<p>Ejemplo:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="576" valign="top">
<p style="text-align: right;"><strong>KIKE GAVILAN</strong></p>
<p style="text-align: right;"><strong>FotoPex.com</strong></p>
<p style="text-align: right;"><strong>DEPARTAMENTO DE SISTEMAS</strong></p>
<p style="text-align: right;"><strong>OF/158892.</strong></p>
<p style="text-align: right;"><strong>Asunto: SOLICITUD DE PERSONAL</strong></p>
<p style="text-align: right;">Huajuapan de León, Oax, a 01 de Septiembre de1 2010</p>
<p><strong>Lic. Omar Estrada</strong><br />
<strong>FotoPex.com</strong><br />
<strong>Departamento de R.H.</strong></p>
<p>En base a la conversación telefónica sostenida el pasado &#8230;. me dirijo a usted para recomendarle&#8230;.</p>
<p>Le escribo esta  carta para recordarle que&#8230;.</p>
<p>El motivo de la presente es el de&#8230;..</p>
<p>Me dirijo a ustedes con respecto al anuncio publicado solicitando personal&#8230;.</td>
</tr>
</tbody>
</table>
<p>Explicamos de forma clara y breve nuestro asunto, utilizando el trato de &#8220;usted&#8221;, sin caer en excesivos formalismos.</p>
<p><strong> Paso 5 &#8211; Despedida</strong></p>
<p>Para finalizar, existe una frase con la que siempre quedaremos bien:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="576" valign="top">
<p style="text-align: center;">Un saludo.</p>
<p style="text-align: center;"><strong>(Firma)</strong></p>
<p style="text-align: center;"><strong>Kike Gavilan</strong></p>
<p style="text-align: center;"><strong>Email:kike@fotopex.com</strong></p>
<p style="text-align: center;"><strong>Tel: (55) 5555 5555</strong></p>
</td>
</tr>
</tbody>
</table>
<p>Podemos anexar información de contacto, como puede ser la dirección postal o el correo electrónico, teléfono fax,  etc&#8230;</p>
<p>Ejemplo:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="576" valign="top">
<p style="text-align: right;"><strong>KIKE GAVILAN</strong></p>
<p style="text-align: right;"><strong>FotoPex.com</strong></p>
<p style="text-align: right;"><strong>DEPARTAMENTO DE SISTEMAS</strong></p>
<p style="text-align: right;"><strong>OF/158892.</strong></p>
<p style="text-align: right;"><strong>Asunto: SOLICITUD DE PERSONAL</strong></p>
<p style="text-align: right;">Huajuapan de León, Oax, a 01 de Septiembre de1 2010</p>
<p><strong>Lic. Omar Estrada</strong><br />
<strong>FotoPex.com</strong><br />
<strong>Departamento de RR.HH.</strong></p>
<p>&nbsp;
<p/>
<p>&nbsp;
<p/>
<p>En base a la conversación telefónica sostenida el pasado &#8230;. me dirijo a usted para recomendarle&#8230;.</p>
<p>Le escribo esta  carta para recordarle que&#8230;.</p>
<p>El motivo de la presente es el de&#8230;..</p>
<p>Me dirijo a ustedes con respecto al anuncio publicado solicitando personal&#8230;.</p>
<p>&nbsp;
<p/>
<p>&nbsp;
<p/>
<p style="text-align: center;">Un saludo.</p>
<p style="text-align: center;"><strong>(Firma)</strong></p>
<p style="text-align: center;"><strong>Kike Gavilan</strong></p>
<p style="text-align: center;"><strong>Email:kike@fotopex.com</strong></p>
<p style="text-align: center;"><strong>Tel: (55) 5555 5555</strong></p>
</td>
</tr>
</tbody>
</table>
<p>Espero que te sea de utilidad y regreses pronto o puedas colaborar con esta comunidad.</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/documentos/como-hacer-una-carta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calendario Escolar 2010-2011</title>
		<link>http://ayuda.fotopex.com/general/calendario-escolar-2010-2011/</link>
		<comments>http://ayuda.fotopex.com/general/calendario-escolar-2010-2011/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 21:01:54 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Calendario]]></category>
		<category><![CDATA[Escolar]]></category>
		<category><![CDATA[Imagen]]></category>
		<category><![CDATA[SEP]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=787</guid>
		<description><![CDATA[El Calendario escolar con las fechas oficiales por la SEP.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ayuda.fotopex.com/wp-content/uploads/2010/08/calendario-escolar-2010-2011.png" target="_blank"><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/08/calendario-escolar-2010-2011-490x409.png" alt="" title="calendario-escolar-2010-2011" width="490" height="409" class="aligncenter size-medium wp-image-788" /></a><br />
 El Calendario escolar con las fechas oficiales por la SEP.</p>
<div style="clear:both;"></div>
<p>
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/general/calendario-escolar-2010-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resaltar Palabras de una Búsqueda con PHP</title>
		<link>http://ayuda.fotopex.com/programacion/php/resaltar-palabras-de-una-busqueda-con-php/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/resaltar-palabras-de-una-busqueda-con-php/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 23:34:00 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[búsqueda]]></category>
		<category><![CDATA[palabra]]></category>
		<category><![CDATA[Resaltar]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=786</guid>
		<description><![CDATA[Si necesitas resaltar determinadas palabras dentro de un texto. Por ejemplo al mostrar los resultados de una búsqueda, podemos resaltar los términos buscados con la siguiente función: Texto Plano PHP: function highlight&#40;$cadena, $arr_palabras&#41; &#123; &#160; &#160; if &#40;!is_array &#40;$arr_palabras&#41; &#124;&#124; empty &#40;$arr_palabras&#41; &#124;&#124; !is_string &#40;$cadena&#41;&#41; &#123; &#160; &#160; &#160; &#160; return false; &#160; &#160; &#125; [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 5px; float: left; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>Si necesitas resaltar determinadas palabras dentro de un texto. Por ejemplo al mostrar los resultados de una búsqueda, podemos resaltar los términos buscados con la siguiente función:</p>
<div style="clear:both;"></div>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">Texto Plano</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:#000000; font-weight:bold;">function</span> highlight<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cadena</span>, <span style="color:#0000FF;">$arr_palabras</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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/is_array" target="_blank"><span style="color:#000066;">is_array</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arr_palabras</span><span style="color:#006600; font-weight:bold;">&#41;</span> || <a href="http://www.php.net/empty" target="_blank"><span style="color:#000066;">empty</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arr_palabras</span><span style="color:#006600; font-weight:bold;">&#41;</span> || !<a href="http://www.php.net/is_string" target="_blank"><span style="color:#000066;">is_string</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cadena</span><span style="color:#006600; font-weight:bold;">&#41;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">false</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:#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; &nbsp; <span style="color:#0000FF;">$str_palabras</span> = <a href="http://www.php.net/implode" target="_blank"><span style="color:#000066;">implode</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'|'</span>, <span style="color:#0000FF;">$arr_palabras</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;&nbsp; &nbsp;<span style="color:#616100;">return</span> <a href="http://www.php.net/preg_replace" target="_blank"><span style="color:#000066;">preg_replace</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'@<span style="color:#000099; font-weight:bold;">\b</span>('</span>.<span style="color:#0000FF;">$str_palabras</span>.<span style="color:#FF0000;">')<span style="color:#000099; font-weight:bold;">\b</span>@si'</span>, <span style="color:#FF0000;">'&lt;strong style=&quot;background-color:yellow&quot;&gt;$1&lt;/strong&gt;'</span>, <span style="color:#0000FF;">$cadena</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>
</ol>
</div>
</div>
</div>
<p></p>
<p>y se utiliza de la siguiente manera:</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">Texto Plano</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:#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:#0000FF;">$Texto</span> = <span style="color:#FF0000;">"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut adipiscing risus nec arcu interdum at lobortis neque auctor. Morbi in gravida ipsum. Nunc imperdiet, metus sit amet fermentum volutpat, nisi tortor auctor dui, sed porttitor augue mi vitae arcu. Mauris vitae ante sit amet elit tincidunt eleifend et tempor est. Aenean vitae viverra velit. Maecenas pulvinar dolor at ante eleifend vitae fermentum dui auctor. Pellentesque fringilla ultrices odio, vitae elementum lorem gravida in. Curabitur tincidunt sagittis luctus. Cras sit amet sagittis sapien. Nunc tempus dapibus nibh, et posuere nibh aliquam in. "</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;">$Palabras</span> = <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Lorem"</span>,<span style="color:#FF0000;">"sit"</span>,<span style="color:#FF0000;">"amet"</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;"><a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> highlight<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$Texto</span>, <span style="color:#0000FF;">$Palabras</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:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/resaltar-palabras-de-una-busqueda-con-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Acortar URL con PHP</title>
		<link>http://ayuda.fotopex.com/programacion/php/acortar-url-con-php/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/acortar-url-con-php/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 23:14:14 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[acortar]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=781</guid>
		<description><![CDATA[Vamos a ver como podemos acortar una dirección url con el servicio tinyurl y php, y es que en ocasiones nos excedemos con las direcciones url y es complicado manejarlas en mensajes de correo electrónico o publicarlas en algún servicio. Texto Plano PHP: &#60;?php function myUrl&#40;$url&#41;&#123; &#160; &#160; $apiurl = "http://tinyurl.com/api-create.php?url=".$url; &#160; &#160; $url_corta = [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/08/tiny-230x230.png" alt="" title="tiny" width="230" height="230" class="alignleft size-thumbnail wp-image-784" /><br />
Vamos a ver como podemos acortar una dirección <strong>url </strong>con el  servicio <strong>tinyurl</strong> y php, y es que en ocasiones nos excedemos con las direcciones url y es complicado manejarlas en mensajes de correo electrónico o publicarlas en algún servicio.</p>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div style="clear:both;"></div>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<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:#000000; font-weight:bold;">function</span> myUrl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$apiurl</span> = <span style="color:#FF0000;">"http://tinyurl.com/api-create.php?url="</span>.<span style="color:#0000FF;">$url</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;">$url_corta</span> = <a href="http://www.php.net/file_get_contents" target="_blank"><span style="color:#000066;">file_get_contents</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$apiurl</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;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$url_corta</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:#FF9933; font-style:italic;">//Ejemplo de uso</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" target="_blank"><span style="color:#000066;">echo</span></a> myUrl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'http://ayuda.fotopex.com/programacion/php/grafica-vertical/'</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:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Así quedaría de una forma más ligera.<br />
<a href="http://tinyurl.com/2fp8s57">http://tinyurl.com/2fp8s57</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/acortar-url-con-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manejo de Miniaturas (Thumbnails) de WordPress</title>
		<link>http://ayuda.fotopex.com/programacion/html/manejo-de-miniaturas-thumbnails-de-wordpress/</link>
		<comments>http://ayuda.fotopex.com/programacion/html/manejo-de-miniaturas-thumbnails-de-wordpress/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 12:46:43 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Miniaturas]]></category>
		<category><![CDATA[Thumbnails]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=780</guid>
		<description><![CDATA[Añadir una miniatura a un post. Podemos añadir las thumbnails a los posts a través de una opción en la barra lateral del panel de creación de posts o desde el menú de subidas de imágenes haciendo clic en “Set Thumbnail”. Pero antes, no olvides que tu plantilla debe contener la instrucción add_theme_support( 'post-thumbnails' ); [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 5px; float: left; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p><strong>Añadir una miniatura a un post.</strong></p>
<p>Podemos añadir las thumbnails a los posts a través de una opción en la barra lateral del panel de creación de posts o desde el menú de subidas de imágenes haciendo clic en “Set Thumbnail”.<br />
Pero antes, no olvides que tu plantilla debe contener la instrucción <strong>add_theme_support( 'post-thumbnails' );</strong> en el archivo <strong>functions.php</strong></p>
<div style="clear:both;"></div>
<p>Ahora si vamos a:<br />
<strong>Mostrar la miniatura en tu plantilla.</strong></p>
<p>Para mostrar la miniatura en tu plantilla, deberás editarla manualmente y llamar a la siguiente función donde quiera que se muestre la imagen:</p>
<div class="igBar"><span id="lphp-15"><a href="#" onclick="javascript:showPlainTxt('php-15'); return false;">Texto Plano</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;">&lt;?php</span> the_post_thumbnail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div style="clear:both;"></div>
<p><span id="more-780"></span><br />
Seguramente haya mucha gente que prefiera adaptarla lo máximo posible a su theme. Esto se puede hacer añadiendo una serie de parámetros a la función, como el tamaño, la clase ( class de CSS), el atributo alt o el title.</p>
<p><strong>Gestionando el tamaño de la miniatura.</strong></p>
<p>Por defecto, el tamaño de la miniatura será el que tengamos seleccionado para las miniaturas de WordPress (‘thumbnail’) aunque se pueden elegir los otros dos tamaños o incluso personalizarlos según nuestros gustos o necesidades:<br />
Tamaño pequeño:</p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">Texto Plano</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:#000000; font-weight:bold;">&lt;?php</span> the_post_thumbnail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'thumbnail'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Tamaño medio:</p>
<div class="igBar"><span id="lphp-17"><a href="#" onclick="javascript:showPlainTxt('php-17'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-17">
<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> the_post_thumbnail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'medium'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Tamaño grande:</p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showPlainTxt('php-18'); return false;">Texto Plano</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;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> the_post_thumbnail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'large'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Tamaño personalizado (ancho, alto):</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<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> the_post_thumbnail<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#CC66CC;color:#800000;">200</span>,<span style="color:#CC66CC;color:#800000;">200</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Si definimos el tamaño de la miniatura de esta manera, cogerá el tamaño normal de la imagen y lo reducirá, no cogerá el tamaño ‘thumbnail’.</p>
<p><strong>Gestionando la clase de la miniatura</strong></p>
<p>La clase de la miniatura servirá para añadirle un estilo predefinido en la hoja de estilos del theme. Por defecto es .wp-post-image, pero podremos elegir la que queramos definiendo nuestro propio estilo:</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<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> the_post_thumbnail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'medium'</span>, <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'class'</span> =&gt; <span style="color:#FF0000;">'imagen_post'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Gestionando los atributos alt y title.</strong></p>
<p>De la misma manera que hemos visto anteriormente, también se pueden modificar a nuestro gusto los atributos ‘alt’ y ‘title’ de la miniatura, pudiendo ponerlo lo que queramos:</p>
<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showPlainTxt('php-21'); return false;">Texto Plano</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:#000000; font-weight:bold;">&lt;?php</span> the_post_thumbnail<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'medium'</span>, <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'class'</span> =&gt; <span style="color:#FF0000;">'alignleft'</span>, <span style="color:#FF0000;">'alt'</span> =&gt; <span style="color:#FF0000;">'alt_que_queramos'</span>, <span style="color:#FF0000;">'title'</span> =&gt; <span style="color:#FF0000;">'titulo_que_queramos'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Incluyendo el código completo y a prueba de fallos.</strong></p>
<p>Deberemos tener en cuenta que los artículos antiguos no tendrán asginada una miniatura, por lo que los deberemos tratar de una manera diferente al resto mediante una comprobación ‘has_post_thumbnail’. En caso afirmativo se mostrará la miniatura, pero en caso negativo se mostrará la miniatura que hayamos utilizado hasta entonces o sino una imagen genérica.</p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">Texto Plano</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;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>&nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/function_exists" target="_blank"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'has_post_thumbnail'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; <span style="color:#006600; font-weight:bold;">&#40;</span>has_post_thumbnail<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;">&#41;</span>&nbsp; <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; the_post_thumbnail<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:#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;">&nbsp; &nbsp; <span style="color:#0000FF;">$postimage</span> = get_post_meta<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">ID</span>, <span style="color:#FF0000;">'post-image'</span>, <span style="color:#000000; font-weight:bold;">true</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;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$postimage</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; &nbsp; &nbsp; <a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;img src=&quot;'</span>.<span style="color:#0000FF;">$postimage</span>.<span style="color:#FF0000;">'&quot; alt=&quot;&quot; /&gt;'</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;">&#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;">&nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;img src=&quot;http://tupagina.com/thumbail_generica.png&quot; alt=&quot;Thumbnail genérica&quot; /&gt;'</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;">&#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> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/html/manejo-de-miniaturas-thumbnails-de-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generador Simple de Claves Aleatorias</title>
		<link>http://ayuda.fotopex.com/programacion/php/generador-simple-de-claves-aleatorias/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/generador-simple-de-claves-aleatorias/#comments</comments>
		<pubDate>Mon, 10 May 2010 19:32:11 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Aleatorio]]></category>
		<category><![CDATA[Clave]]></category>
		<category><![CDATA[Contraseña]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[Password]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=770</guid>
		<description><![CDATA[Vamos a realizar 4 ejemplos para generar un password aleatorio y así obtener contraseñas de una forma fácil. El primer generador sencillo y simple de claves aleatorias. Utilizaremos las instrucciones md5() y rand(), sin duda el ejemplo más sencillo, fácil y rápido de implementar. Texto Plano PHP: &#60;?php function password_rand_md5&#40;&#41;&#123; &#160; &#160; $longitud = 8; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/05/password-fotopex.png" alt="" title="password-fotopex" width="181" height="171" class="alignleft size-full wp-image-771" />Vamos a realizar <strong>4 ejemplos</strong> para generar un password aleatorio y así obtener contraseñas de una forma fácil.<br />
<strong>El primer generador</strong> sencillo y simple de claves aleatorias. Utilizaremos las instrucciones <strong>md5()</strong> y<strong> rand()</strong>, sin duda el ejemplo más <strong>sencillo</strong>,<strong> fácil </strong>y <strong>rápido </strong>de implementar.</p>
<div style="clear:both;"></div>
<div class="igBar"><span id="lphp-27"><a href="#" onclick="javascript:showPlainTxt('php-27'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-27">
<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:#000000; font-weight:bold;">function</span> password_rand_md5<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;">&nbsp; &nbsp; <span style="color:#0000FF;">$longitud</span> = <span style="color:#CC66CC;color:#800000;">8</span>; <span style="color:#FF9933; font-style:italic;">// longitud de caracteres que queremos</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;">$password</span> = <a href="http://www.php.net/substr" target="_blank"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/md5" target="_blank"><span style="color:#000066;">md5</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/rand" target="_blank"><span style="color:#000066;">rand</span></a><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;">&#41;</span>,<span style="color:#CC66CC;color:#800000;">0</span>,<span style="color:#0000FF;">$longitud</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;">&nbsp; &nbsp; <a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$password</span> ; <span style="color:#FF9933; font-style:italic;">// mostramos la contraseña</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;">password_rand_md5<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;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>&nbsp;</p>
<p><span id="more-770"></span></p>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p><strong> En el segundo ejemplo</strong> vamos a generar un pasword con una palabra y 2 dígitos, podemos complicarlo si agregamos símbolos como #&#038;)($ etc. Considero que este ejemplo es el más sencillo y con <strong>contraseñas </strong>fáciles de recordar.</p>
<div style="clear:both;"></div>
<div class="igBar"><span id="lphp-28"><a href="#" onclick="javascript:showPlainTxt('php-28'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-28">
<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:#000000; font-weight:bold;">function</span> password_palabra<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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/srand" target="_blank"><span style="color:#000066;">srand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>float<span style="color:#006600; font-weight:bold;">&#41;</span> <a href="http://www.php.net/microtime" target="_blank"><span style="color:#000066;">microtime</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#CC66CC;color:#800000;">10000000</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$numeros</span> =&nbsp; <a href="http://www.php.net/range" target="_blank"><span style="color:#000066;">range</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">1</span>,<span style="color:#CC66CC;color:#800000;">9</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; &nbsp; <span style="color:#0000FF;">$texto</span> = <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Enero'</span>, <span style="color:#FF0000;">'Febrero'</span>, <span style="color:#FF0000;">'Marzo'</span>, <span style="color:#FF0000;">'Abril'</span>, <span style="color:#FF0000;">'Mayo'</span>, <span style="color:#FF0000;">'Junio'</span>, <span style="color:#FF0000;">'Julio'</span>,<span style="color:#FF0000;">'Agosto'</span>, <span style="color:#FF0000;">'Septiembre'</span>, <span style="color:#FF0000;">'Octubre'</span>, <span style="color:#FF0000;">'Noviembre'</span>, <span style="color:#FF0000;">'Diciembre'</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$texto_aleatorio</span> = <a href="http://www.php.net/array_rand" target="_blank"><span style="color:#000066;">array_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$texto</span>, <span style="color:#CC66CC;color:#800000;">2</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; &nbsp; <span style="color:#0000FF;">$numeros_aleatorios</span> = <a href="http://www.php.net/array_rand" target="_blank"><span style="color:#000066;">array_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$numeros</span>, <span style="color:#CC66CC;color:#800000;">2</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;">&nbsp; &nbsp; </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:#FF9933; font-style:italic;">// generamos la clave con una palabra y dos numeros al final</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:#0000FF;">$password</span>= <span style="color:#0000FF;">$texto</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$texto_aleatorio</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#0000FF;">$numeros</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$numeros_aleatorios</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#0000FF;">$numeros</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$numeros_aleatorios</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</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:#FF9933; font-style:italic;">// devolvemos la contraseña</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:#616100;">return</span> <span style="color:#0000FF;">$password</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;">$password</span> = password_palabra<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;"><span style="color:#FF9933; font-style:italic;">// devuelve algocom Septiembre37</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" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$password</span>.<span style="color:#FF0000;">'&lt;br /&gt;'</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>
<p><strong>En el tercer ejemplo</strong> vamos a componer el <strong>password </strong>con letras aleatorias y de igual forma agregaremos 2 dígitos.</p>
<div class="igBar"><span id="lphp-29"><a href="#" onclick="javascript:showPlainTxt('php-29'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-29">
<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:#000000; font-weight:bold;">function</span> password_rand<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$longitud</span> = <span style="color:#CC66CC;color:#800000;">7</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$letras</span> = <a href="http://www.php.net/range" target="_blank"><span style="color:#000066;">range</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'a'</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$numeros</span> =&nbsp; <a href="http://www.php.net/range" target="_blank"><span style="color:#000066;">range</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">1</span>,<span style="color:#CC66CC;color:#800000;">9</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$numeros_aleatorios</span> = <a href="http://www.php.net/array_rand" target="_blank"><span style="color:#000066;">array_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$numeros</span>, <span style="color:#CC66CC;color:#800000;">2</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; &nbsp; <a href="http://www.php.net/srand" target="_blank"><span style="color:#000066;">srand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>float<span style="color:#006600; font-weight:bold;">&#41;</span> <a href="http://www.php.net/microtime" target="_blank"><span style="color:#000066;">microtime</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#CC66CC;color:#800000;">10000000</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;">&nbsp; &nbsp; </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;">$password</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$rand_keys</span> = <a href="http://www.php.net/array_rand" target="_blank"><span style="color:#000066;">array_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$letras</span>, <span style="color:#0000FF;">$longitud</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; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rand_keys</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$password</span> .= <span style="color:#0000FF;">$letras</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</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:#006600; font-weight:bold;">&#125;</span>&nbsp; &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;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// agregamos dos numeros al final</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;">$password</span> = <a href="http://www.php.net/substr" target="_blank"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$password</span>,<span style="color:#CC66CC;color:#800000;">0</span>,<span style="color:#0000FF;">$longitud</span>-<span style="color:#CC66CC;color:#800000;">2</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;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$password</span>.<span style="color:#0000FF;">$numeros</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$numeros_aleatorios</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#0000FF;">$numeros</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$numeros_aleatorios</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</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:#FF9933; font-style:italic;">// pedimos una clave con 10 characteres</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;">$password</span> = password_rand<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">10</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:#FF9933; font-style:italic;">// devuelve algo como cejklosv12</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;">&nbsp;</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" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$password</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;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Para el cuarto ejemplo</strong> vamos a generar la contraseña alternando vocales y consonantes.</p>
<div class="igBar"><span id="lphp-30"><a href="#" onclick="javascript:showPlainTxt('php-30'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-30">
<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:#000000; font-weight:bold;">function</span> password_rand_alt<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$longitud</span>=<span style="color:#CC66CC;color:#800000;">8</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; &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;">&nbsp; &nbsp; <span style="color:#0000FF;">$voc</span> = <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span>a,e,i,o,u<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:#0000FF;">$con</span> = <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span>b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,w,x,y,z<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;">&nbsp; &nbsp; <span style="color:#0000FF;">$numeros</span> =&nbsp; <a href="http://www.php.net/range" target="_blank"><span style="color:#000066;">range</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">1</span>,<span style="color:#CC66CC;color:#800000;">9</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; &nbsp; <span style="color:#0000FF;">$numeros_aleatorios</span> = <a href="http://www.php.net/array_rand" target="_blank"><span style="color:#000066;">array_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$numeros</span>, <span style="color:#CC66CC;color:#800000;">2</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$password</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$inicio</span>&nbsp; = <a href="http://www.php.net/mt_rand" target="_blank"><span style="color:#000066;">mt_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>,<span style="color:#CC66CC;color:#800000;">1</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;">&nbsp; &nbsp; <span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$n</span>=<span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$n</span>&lt;<span style="color:#0000FF;">$longitud</span>; <span style="color:#0000FF;">$n</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$inicio</span>==<span style="color:#CC66CC;color:#800000;">1</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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$inicio</span>=<span style="color:#CC66CC;color:#800000;">0</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$password</span> .= <span style="color:#0000FF;">$con</span><span style="color:#006600; font-weight:bold;">&#91;</span><a href="http://www.php.net/mt_rand" target="_blank"><span style="color:#000066;">mt_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>,<a href="http://www.php.net/count" target="_blank"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$con</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</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; &nbsp; &nbsp; &nbsp; &nbsp; <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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$password</span> .= <span style="color:#0000FF;">$voc</span><span style="color:#006600; font-weight:bold;">&#91;</span><a href="http://www.php.net/mt_rand" target="_blank"><span style="color:#000066;">mt_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>,<a href="http://www.php.net/count" target="_blank"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$voc</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$password</span> .= <span style="color:#0000FF;">$con</span><span style="color:#006600; font-weight:bold;">&#91;</span><a href="http://www.php.net/mt_rand" target="_blank"><span style="color:#000066;">mt_rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>,<a href="http://www.php.net/count" target="_blank"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$con</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</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:#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; &nbsp; <span style="color:#0000FF;">$password</span> = <a href="http://www.php.net/substr" target="_blank"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$password</span>,<span style="color:#CC66CC;color:#800000;">0</span>,<span style="color:#0000FF;">$longitud</span>-<span style="color:#CC66CC;color:#800000;">2</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; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$password</span>.<span style="color:#0000FF;">$numeros</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$numeros_aleatorios</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#0000FF;">$numeros</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$numeros_aleatorios</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</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;"><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:#FF9933; font-style:italic;">// pedimos una clave con 10 characteres</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;">$password</span> = password_rand_alt<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">10</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:#FF9933; font-style:italic;">//devuelve algo como etopoyar36</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" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$password</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>
<p>Si deseas puedes bajar el archivo de ejemplo en <a href='http://ayuda.fotopex.com/wp-content/uploads/2010/05/generador-claves.zip'>este enlace con el nombre de generador-claves.zip</a>.</p>
<p>Puedes ejecutar un ejemplo en <a href="http://ayuda.fotopex.com/ejemplos/generador-claves.php">este enlace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/generador-simple-de-claves-aleatorias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Botón con Enlace URL</title>
		<link>http://ayuda.fotopex.com/programacion/html/boton-con-enlace-url/</link>
		<comments>http://ayuda.fotopex.com/programacion/html/boton-con-enlace-url/#comments</comments>
		<pubDate>Sat, 01 May 2010 20:51:40 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Botón]]></category>
		<category><![CDATA[Enlace]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=768</guid>
		<description><![CDATA[Algunos ejemplos de como un button haga las funciones de enlace a otra pagina. Texto Plano HTML: &#60;input type="button" onclick="location.href='http://fotopex.com'" value="FotoPex.com" onmouseover="window.status='dentro'" onmouseout="window.status=''" /&#62; También se puede dar estilo al enlace para que se vea como un botón: FotoPex.com Texto Plano HTML: &#60;a href="http://fotopex.com/" style="background-color: #eeeeee; border: 1px black outset"&#62; FotoPex.com&#60;/a&#62;]]></description>
			<content:encoded><![CDATA[<p>
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<p>Algunos ejemplos de como un button haga las funciones de enlace a otra pagina.<br />
<input type="button" onclick="location.href='http://fotopex.com/'" value="FotoPex.com" onmouseover="window.status='dentro'" onmouseout="window.status=''" />
<div class="igBar"><span id="lhtml-33"><a href="#" onclick="javascript:showPlainTxt('html-33'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-33">
<div class="html">
<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: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"button"</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">"location.href='http://fotopex.com'"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"FotoPex.com"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066;">onmouseover</span>=<span style="color: #ff0000;">"window.status='dentro'"</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: #000066;">onmouseout</span>=<span style="color: #ff0000;">"window.status=''"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>También se puede dar estilo al enlace para que se vea como un botón: <a href="http://fotopex.com/" style="background-color: #eeeeee; border: 1px black outset"> FotoPex.com</a></p>
<div class="igBar"><span id="lhtml-34"><a href="#" onclick="javascript:showPlainTxt('html-34'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-34">
<div class="html">
<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: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"http://fotopex.com/"</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"background-color: #eeeeee; border: 1px black outset"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span> FotoPex.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/html/boton-con-enlace-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Devolver un Array en una Funcion con Return</title>
		<link>http://ayuda.fotopex.com/programacion/php/devolver-un-array-en-una-funcion-con-return/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/devolver-un-array-en-una-funcion-con-return/#comments</comments>
		<pubDate>Sat, 01 May 2010 20:42:19 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Función]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=766</guid>
		<description><![CDATA[La idea es simple: vamos a devolver un array con return dentro de una función, después creas un segundo array al cual se le pasaran los datos que devuelve la función. Aquí esta un ejemplo muy sencillo: Texto Plano PHP: &#60;?php //creamos nuestra función. function saludo&#40;&#41;&#123; &#160; $matriz = array&#40;"Gracias", "por visitar", "FotoPex.com"&#41;; &#160; return [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/05/devolver-array-return.png" alt="" title="devolver-array-return" width="500" height="221" class="aligncenter size-full wp-image-767" /><br />
La idea es simple: vamos a devolver un array con return dentro de una función, después creas un segundo <strong>array </strong>al cual se le pasaran los datos que devuelve la función.</p>
<p>Aquí esta un ejemplo muy sencillo:<br />
<span id="more-766"></span></p>
<div class="igBar"><span id="lphp-36"><a href="#" onclick="javascript:showPlainTxt('php-36'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-36">
<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:#FF9933; font-style:italic;">//creamos nuestra función.</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> saludo<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; <span style="color:#0000FF;">$matriz</span> = <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Gracias"</span>, <span style="color:#FF0000;">"por visitar"</span>, <span style="color:#FF0000;">"FotoPex.com"</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;">&nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$matriz</span>; <span style="color:#FF9933; font-style:italic;">// regresamos el arreglo.</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>&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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$mostrar</span>=<a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">// declaramos la nueva variable.</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; <span style="color:#0000FF;">$mostrar</span>=saludo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// aquí atrapamos los valores del array devuelto por la función</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// mostramos el resultado</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; <a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$mostrar</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#FF0000;">' '</span>.<span style="color:#0000FF;">$mostrar</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#FF0000;">' '</span>.<span style="color:#0000FF;">$mostrar</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</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>
<p>
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/devolver-un-array-en-una-funcion-con-return/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gráfica Vertical</title>
		<link>http://ayuda.fotopex.com/programacion/php/grafica-vertical/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/grafica-vertical/#comments</comments>
		<pubDate>Sat, 01 May 2010 20:11:50 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[colores]]></category>
		<category><![CDATA[Gráfica]]></category>
		<category><![CDATA[Vertical]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=762</guid>
		<description><![CDATA[Aprovechando que hemos lanzado el concurso para seleccionar a la Señorita Prepa Colosio 2010 y Chico Prepa Colosio 2010, vamos a mostrarte como hacer una Gráfica Vertical. En el siguiente ejemplo vamos a usar dos tablas: encuestas y respuestas, la idea como siempre es que entiendas lo básico y después podrías mejorarlo. Texto Plano PHP: [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/05/grafica-vertical.png" alt="" title="grafica-vertical" width="601" height="158" class="aligncenter size-full wp-image-763" /><br />
Aprovechando que hemos lanzado el concurso para seleccionar a la <a href="http://votapex.com/?idPoll=2" target="_blank">Señorita Prepa Colosio 2010</a> y <a href="http://votapex.com/?idPoll=1" target="_blank">Chico Prepa Colosio 2010</a>, vamos a mostrarte como hacer una Gráfica Vertical.</p>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>En el siguiente ejemplo vamos a usar dos tablas: encuestas y respuestas, la idea como siempre es que entiendas lo básico y después podrías mejorarlo.</p>
<div style="clear:both;"></div>
<p><span id="more-762"></span></p>
<div class="igBar"><span id="lphp-39"><a href="#" onclick="javascript:showPlainTxt('php-39'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-39">
<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;">&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:#008000;">/****************************************</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;">* Grafica vertical en base a dos tablas *</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;">*&nbsp; &nbsp; &nbsp; www.ayuda.FotoPex.com&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *</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;">*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*</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;">&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> grafica_encuesta_vertical<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$idEncuesta</span>=<span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; </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:#FF9933; font-style:italic;">// seleccionamos los colores que utilizaremos en cada barra</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:#0000FF;">$colores</span> = <a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'3366CC'</span>,<span style="color:#FF0000;">'DC3912'</span>,<span style="color:#FF0000;">'109618'</span>,<span style="color:#FF0000;">'FF9900'</span>,<span style="color:#FF0000;">'375181'</span>,<span style="color:#FF0000;">'FFCC33'</span>,<span style="color:#FF0000;">'082454'</span>,<span style="color:#FF0000;">'a3129e'</span>,<span style="color:#FF0000;">'e57e0f'</span>,<span style="color:#FF0000;">'256605'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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;">$rs</span>=<a href="http://www.php.net/mysql_query" target="_blank"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'SELECT encuestas.pregunta FROM `respuestas` </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:#FF0000;">&nbsp; &nbsp; INNER JOIN encuestas ON encuestas.id = respuestas.id_poll </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; WHERE respuestas.id_poll = <span style="color:#000099; font-weight:bold;">\'</span>'</span>.<span style="color:#0000FF;">$idEncuesta</span>.<span style="color:#FF0000;">'<span style="color:#000099; font-weight:bold;">\'</span> ;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>or <a href="http://www.php.net/die" target="_blank"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/mysql_error" target="_blank"><span style="color:#000066;">mysql_error</span></a><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;">&#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;">&nbsp; &nbsp; <span style="color:#0000FF;">$total_votos</span> = <a href="http://www.php.net/mysql_num_rows" target="_blank"><span style="color:#000066;">mysql_num_rows</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rs</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// obtenemos el total de los votos</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;">$rowPreg</span> = <a href="http://www.php.net/mysql_fetch_object" target="_blank"><span style="color:#000066;">mysql_fetch_object</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rs</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$NombreEncuesta</span> = <span style="color:#0000FF;">$rowPreg</span>-&gt;<span style="color:#006600;">pregunta</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/mysql_free_result" target="_blank"><span style="color:#000066;">mysql_free_result</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rs</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp;&nbsp;&nbsp;&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;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//buscamos las respuestas</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;">$ssql</span>=<span style="color:#FF0000;">'SELECT `id_nombre` as participante , count( *&nbsp; ) AS votos </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:#FF0000;">&nbsp; &nbsp; FROM `respuestas` </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; WHERE respuestas.id_poll = <span style="color:#000099; font-weight:bold;">\'</span>'</span>.<span style="color:#0000FF;">$idEncuesta</span>.<span style="color:#FF0000;">'<span style="color:#000099; font-weight:bold;">\'</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:#FF0000;">&nbsp; &nbsp; GROUP BY `id_opcion` LIMIT 10; '</span>; <span style="color:#FF9933; font-style:italic;">// limte de 10 opciones para votar</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;">$result</span> = <a href="http://www.php.net/mysql_query" target="_blank"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ssql</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$numOpciones</span> = <a href="http://www.php.net/mysql_num_rows" target="_blank"><span style="color:#000066;">mysql_num_rows</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// obtenenemos el numero real de opciones votadas</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;">$anchoBarra</span> = <span style="color:#CC66CC;color:#800000;">10</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:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$numOpciones</span>&gt; <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$anchoBarra</span> = @<a href="http://www.php.net/round" target="_blank"><span style="color:#000066;">round</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">100</span>/<span style="color:#0000FF;">$numOpciones</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// se expresara en %</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;">$ontRowOpt</span> = <span style="color:#CC66CC;color:#800000;">0</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:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$row</span>=<a href="http://www.php.net/mysql_fetch_object" target="_blank"><span style="color:#000066;">mysql_fetch_object</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</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:#0000FF;">$porcentaje</span> = <a href="http://www.php.net/round" target="_blank"><span style="color:#000066;">round</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">votos</span>/<span style="color:#0000FF;">$total_votos</span><span style="color:#006600; font-weight:bold;">&#41;</span>*<span style="color:#CC66CC;color:#800000;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$votos_x_opcion</span>=<span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">votos</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:#0000FF;">$barras</span>.= <span style="color:#FF0000;">'&lt;td height=&quot;100px;&quot; width=&quot;'</span>.<span style="color:#0000FF;">$anchoBarra</span>.<span style="color:#FF0000;">'%&quot; valign=&quot;bottom&quot;&gt;'</span>.<span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">votos</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;">'&lt;br /&gt;&lt;div style=&quot;background:#'</span>.<span style="color:#0000FF;">$colores</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$ontRowOpt</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#FF0000;">'; height:'</span>.<span style="color:#0000FF;">$porcentaje</span>.<span style="color:#FF0000;">'px;&quot;&gt;&lt;/div&gt;&lt;/td&gt;'</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:#0000FF;">$footers</span>.= <span style="color:#FF0000;">'&lt;td height=&quot;15px;&quot;&gt;'</span>.<span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">participante</span>.<span style="color:#FF0000;">'&lt;/td&gt;'</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:#0000FF;">$ontRowOpt</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:#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; &nbsp; <a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;div class=&quot;box1&quot;&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;table height=&quot;170px;&quot; width=&quot;600px;&quot;&gt;</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:#FF0000;">&nbsp; &nbsp; &lt;tr&nbsp; align=&quot;center&quot;&gt;&lt;td colspan=&quot;'</span>.<span style="color:#0000FF;">$numOpciones</span>.<span style="color:#FF0000;">'&quot;&gt;&lt;b style=&quot;color:#055A91&quot;&gt;'</span>.<a href="http://www.php.net/html_entity_decode" target="_blank"><span style="color:#000066;">html_entity_decode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$NombreEncuesta</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">' '</span>.<span style="color:#0000FF;">$total_votos</span>.<span style="color:#FF0000;">' Votos en Total&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;tr&nbsp; align=&quot;center&quot;&gt;'</span>.<span style="color:#0000FF;">$barras</span>.<span style="color:#FF0000;">'&lt;/tr&gt;</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:#FF0000;">&nbsp; &nbsp; &lt;tr&nbsp; align=&quot;center&quot;&gt;'</span>.<span style="color:#0000FF;">$footers</span>.<span style="color:#FF0000;">'&lt;/tr&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;/table&gt;</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:#FF0000;">&nbsp; &nbsp; &lt;/div&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;div class=&quot;divClear&quot;&gt;&lt;/div&gt;'</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:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>ahora solo necesitamos llamarla </p>
<div class="igBar"><span id="lphp-40"><a href="#" onclick="javascript:showPlainTxt('php-40'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-40">
<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> grafica_encuesta_vertical<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$idPoll</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Algunas veces hay problemas con el Copy/Paste, así que este es el archivo del ejemplo.<br />
<a href='http://ayuda.fotopex.com/wp-content/uploads/2010/05/ejemplo-grafica-vertical.zip'>Ejemplo Gráfica Vertical</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/grafica-vertical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convertir Acentos a minúsculas en php</title>
		<link>http://ayuda.fotopex.com/programacion/php/convertir-acentos-a-minusculas-en-php/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/convertir-acentos-a-minusculas-en-php/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 16:20:07 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[mb_strtolower]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[strtolower]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=758</guid>
		<description><![CDATA[mb_strtolower devuelve un string con todas sus letras en minúsculas. Ejemplo: Texto Plano PHP: echo strtolower&#40;'LEÓN'&#41; Se queda ígual: leÓn Y utilizando la función mb_strtolower con la codificación utf8: Texto Plano PHP: $str = mb_strtolower&#40; $str,"UTF-8"&#41;;]]></description>
			<content:encoded><![CDATA[<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p><strong>mb_strtolower</strong> devuelve un string con todas sus letras en <strong>minúsculas</strong>.<br />
Ejemplo:</p>
<div style="clear:both;"></div>
<div class="igBar"><span id="lphp-43"><a href="#" onclick="javascript:showPlainTxt('php-43'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-43">
<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" target="_blank"><span style="color:#000066;">echo</span></a> <a href="http://www.php.net/strtolower" target="_blank"><span style="color:#000066;">strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'LEÓN'</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Se queda ígual: leÓn</p>
<p>Y utilizando la función <strong>mb_strtolower</strong> con la codificación utf8:</p>
<div class="igBar"><span id="lphp-44"><a href="#" onclick="javascript:showPlainTxt('php-44'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-44">
<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;">$str</span> = <a href="http://www.php.net/mb_strtolower" target="_blank"><span style="color:#000066;">mb_strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$str</span>,<span style="color:#FF0000;">"UTF-8"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/convertir-acentos-a-minusculas-en-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
