<?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>Bufa Webmaster &#187; PHP</title>
	<atom:link href="http://www.bufa.es/web/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bufa.es</link>
	<description>Recursos web en español</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:47:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress: query de determinados ID post/pages</title>
		<link>http://www.bufa.es/wordpress-query-id-post/</link>
		<comments>http://www.bufa.es/wordpress-query-id-post/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 10:34:17 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[post__in]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1592</guid>
		<description><![CDATA[En WordPress si queremos realizar un query o consulta de uno/s determinado/s post utilizando el &#8220;ID&#8221; de estos podemos utilizar la key &#8220;post__in&#8221; y pasarle como valor un array de los id de los post que queremos listar. Un ejemplo: ...]]></description>
			<content:encoded><![CDATA[<p>En WordPress si queremos realizar un query o consulta de uno/s determinado/s post utilizando el &#8220;ID&#8221; de estos podemos utilizar la key &#8220;post__in&#8221; y pasarle como valor un array de los id de los post que queremos listar.</p>
<p>Un ejemplo:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$ids</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1562</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">789</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// en este caso solo listo solo los post de tipo 'page' con 'id': 1562 y 789</span><br />
query_posts<span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'post__in'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ids</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'showposts'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">10</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// bla, bla, bla...</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/wordpress-query-id-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Eliminar espacios y tabulaciones entre tags</title>
		<link>http://www.bufa.es/php-eliminar-espacios-tabulaciones-tags/</link>
		<comments>http://www.bufa.es/php-eliminar-espacios-tabulaciones-tags/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 22:38:33 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cadenas]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1589</guid>
		<description><![CDATA[Es muy probable que en algún momento que necesiteis mostrar un determinado código html sin tabulaciones ni espacioes entre tags (ya sea para comprimir una página web, utilizarlo en javascript, o otras razones). A continuación una simple función que se ...]]></description>
			<content:encoded><![CDATA[<p>Es muy probable que en algún momento que necesiteis mostrar un determinado código html sin tabulaciones ni espacioes entre tags (ya sea para <a href="http://www.bufa.es/comprimir-codigo-html-php/">comprimir una página web</a>, utilizarlo en javascript, o otras razones).</p>
<p>A continuación una simple función que se encarga de buscar y reemplazar espacios en blanco entre etiquetas html:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> limpiahtml<span style="color: #009900;">&#40;</span><span style="color: #000088;">$codigo</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$buscar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\&gt;[^\S ]+/s'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/[^\S ]+\&lt;/s'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/(\s)+/s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$reemplazar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&gt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'\\1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$codigo</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buscar</span><span style="color: #339933;">,</span> reemplazar<span style="color: #339933;">,</span> <span style="color: #000088;">$codigo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$codigo</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&gt; &lt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&gt;&lt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$codigo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$codigo</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Un ejemplo de un determinado código html con tabulaciones y espacios entre tags:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;estilo1&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; León<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<p>Un ejemplo de como quedaría el código anterior utilizando la función php &#8220;limpiahtml&#8221;:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;estilo1&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span>León<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/php-eliminar-espacios-tabulaciones-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Función php para decodificar caracteres a UTF-8</title>
		<link>http://www.bufa.es/funcion-php-decodificar-caracteres-utf-8/</link>
		<comments>http://www.bufa.es/funcion-php-decodificar-caracteres-utf-8/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 07:00:03 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[str_replace]]></category>
		<category><![CDATA[UTF-8]]></category>
		<category><![CDATA[utf_unicode_ci]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1549</guid>
		<description><![CDATA[Si teneis problemas con los caracteres (acentos, eñes, etc&#8230;) de una cadena en php, segurmanente sea por la codificación de esos caracteres esten en latin. La siguiente función php se encarga de buscar y reemplazar (utilizando str_replace()) esos caracteres por ...]]></description>
			<content:encoded><![CDATA[<p>Si teneis problemas con los caracteres (acentos, eñes, etc&#8230;) de una cadena en php, segurmanente sea por la codificación de esos caracteres esten en latin. La siguiente función php se encarga de buscar y reemplazar (utilizando str_replace()) esos caracteres por los mismos ya codificados en UTF8.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> decodificar_utf8<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$buscar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'À'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Á'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Â'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ã'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ä'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Å'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Æ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ă'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ą'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ç'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ć'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Č'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Œ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ď'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Đ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'à'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'á'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'â'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ã'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ä'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'å'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'æ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ă'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ą'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ç'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ć'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'č'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'œ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ď'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'đ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'È'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'É'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ê'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ë'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ę'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ě'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ğ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ì'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Í'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Î'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ï'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'İ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ĺ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ľ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ł'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'è'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'é'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ê'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ë'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ę'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ě'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ğ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ì'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'í'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'î'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ï'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ı'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ĺ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ľ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ł'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ñ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ń'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ň'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ò'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ó'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ô'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Õ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ö'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ø'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ő'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ŕ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ř'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ś'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ş'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Š'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ñ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ń'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ň'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ò'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ó'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ô'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ö'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ø'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ő'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ŕ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ř'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ś'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ş'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'š'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ţ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ť'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ù'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ú'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Û'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ų'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ü'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ů'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ű'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ý'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ß'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ź'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ż'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ž'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ţ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ť'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ù'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ú'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'û'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ų'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ü'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ů'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ű'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ý'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ÿ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ź'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ż'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ž'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'А'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Б'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'В'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Г'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Д'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Е'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ё'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ж'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'З'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'И'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Й'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'К'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Л'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'М'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Н'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'О'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'П'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Р'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'а'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'б'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'в'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'г'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'д'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'е'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ё'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ж'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'з'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'и'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'й'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'к'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'л'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'м'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'н'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'о'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'р'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'С'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Т'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'У'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ф'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Х'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ц'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ч'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ш'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Щ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ъ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ы'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ь'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Э'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ю'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Я'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'с'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'т'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'у'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ф'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'х'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ц'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ч'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ш'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'щ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ъ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ы'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ь'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'э'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ю'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'я'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$remplazar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'AE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CE'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'D'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'D'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ae'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ce'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'d'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'d'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'G'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'L'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'L'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'L'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'g'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'l'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'l'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'l'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'R'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'S'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'S'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'S'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'s'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'s'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'s'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'T'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'T'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Y'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Z'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'t'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'t'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'y'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'z'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'X'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'K'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'M'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'H'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'P'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'x'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'k'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'m'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'h'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'p'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'T'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'X'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'W'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'W'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'t'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'x'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buscar</span><span style="color: #339933;">,</span> <span style="color: #000088;">$remplazar</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Consejos para evitaros futuros problemas de la <strong>codificación</strong> de caracteres de vuestra base de datos <strong>MySql</strong>:</p>
<p>1. Los campos string y deben estar en utf8_spanish_ci y el cotejamiento de las tablas en utf_unicode_ci</p>
<p>2. Utilizar el siguiente meta en el <head> de vuestras pa´ginas web:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">meta</span></a> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></div>
<p>3. Si utilizais php, insertar el siguiente código justo antes de vuestra query:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SET NAMES 'utf8'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/funcion-php-decodificar-caracteres-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: calcular las dimensiones de una imagen</title>
		<link>http://www.bufa.es/php-calcular-dimensiones-imagen/</link>
		<comments>http://www.bufa.es/php-calcular-dimensiones-imagen/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 22:34:07 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[alto]]></category>
		<category><![CDATA[ancho]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1494</guid>
		<description><![CDATA[Para obtener las dimensiones de una imagen o foto en php utilizaremos la función getimagesize(), con la que podemos averiguar el tamaño de un archivo de imagen, las dimensiones (ancho, alto), y el tipo de archivo (gif, jpg, png, bmp, ...]]></description>
			<content:encoded><![CDATA[<p>Para obtener las dimensiones de una imagen o foto en php utilizaremos la función<strong> getimagesize()</strong>, con la que podemos averiguar el tamaño de un archivo de imagen, las <strong>dimensiones</strong> (ancho, alto), y el <strong>tipo de archivo</strong> (gif, jpg, png, bmp, etc&#8230;) y los <strong>atributos</strong> (width=&#8221;" height=&#8221;") con el alto/ancho para ser usados dentro de la etiqueta IMG de HTML).</p>
<p>Modo de uso (acordaros de reemplazar &#8220;MI_IMAGEN.jpg&#8221; por el nombre de vuestra imagen):</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/list"><span style="color: #990000;">list</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #339933;">,</span> <span style="color: #000088;">$type</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/getimagesize"><span style="color: #990000;">getimagesize</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MI_IMAGEN.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Ancho: &quot;</span> <span style="color: #339933;">.</span><span style="color: #000088;">$width</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Alto: &quot;</span> <span style="color: #339933;">.</span><span style="color: #000088;">$height</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Tipo: &quot;</span> <span style="color: #339933;">.</span><span style="color: #000088;">$type</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Atributos: &quot;</span> <span style="color: #339933;">.</span><span style="color: #000088;">$attr</span><span style="color: #339933;">;</span></div></div>
<p>Un ejemplo de Resultado:</p>
<p>Ancho: 800<br />
Alto: 600<br />
Tipo: 2<br />
Atributos: width=&#8221;800&#8243; height=&#8221;600&#8243;</p>
<p>&#8212;</p>
<p>El tipo de imagen vemos que es numérico, pero si queremos averiguar a que formato se corresponde cada número os dejo la siguiente tabla con sus valores:</p>
<p><strong>Tipos de imagen</strong>:</p>
<table width="100%" border="0" cellspacing="0">
<tbody>
<tr>
<td width="25%">1 = GIF</td>
<td width="35%">5 = PSD</td>
<td>9 = JPC</td>
<td>13 = SWC</td>
</tr>
<tr>
<td>2 = JPG</td>
<td>6 = BMP</td>
<td>10 = JP2</td>
<td>14 = IFF</td>
</tr>
<tr>
<td>3 = PNG</td>
<td>7 = TIFF</td>
<td>11 = JPX</td>
<td>15 = WBMP</td>
</tr>
<tr>
<td>4 = SWF</td>
<td>8 = TIFF</td>
<td> 12 = JB2</td>
<td>16 = XBM</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/php-calcular-dimensiones-imagen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extraer urls con PHP</title>
		<link>http://www.bufa.es/extraer-urls-php/</link>
		<comments>http://www.bufa.es/extraer-urls-php/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 19:35:46 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[expresiones regulares]]></category>
		<category><![CDATA[preg_match_all]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1408</guid>
		<description><![CDATA[Función php para sacar o extraer todas las urls de una determinada cadena, página web&#8230; usando expresiones regulares. function extraerURLs&#40;$cadena&#41;&#123; &#160; &#160; $regex = '/https?\:\/\/[^\&#34; ]+/i'; &#160; &#160; preg_match_all&#40;$regex, $cadena, $partes&#41;; &#160; &#160; return &#40;$partes&#91;0&#93;&#41;; &#125; // Llamamos a la ...]]></description>
			<content:encoded><![CDATA[<p>Función php para sacar o extraer todas las urls de una determinada cadena, página web&#8230; usando expresiones regulares.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> extraerURLs<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$regex</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/https?\:\/\/[^\&quot; ]+/i'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/preg_match_all"><span style="color: #990000;">preg_match_all</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$regex</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cadena</span><span style="color: #339933;">,</span> <span style="color: #000088;">$partes</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$partes</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Llamamos a la función y le pasamos la cadena a buscar</span><br />
<span style="color: #000088;">$urls</span> <span style="color: #339933;">=</span> extraerURLs<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Listamos los resultados</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$urls</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/extraer-urls-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Función PHP para reemplazar caracteres especiales en XML</title>
		<link>http://www.bufa.es/funcion-php-reemplazar-caracteres-xml/</link>
		<comments>http://www.bufa.es/funcion-php-reemplazar-caracteres-xml/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 09:29:54 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1319</guid>
		<description><![CDATA[Aquí una función php que utilizo al generar archivos XML, para &#8220;limpiar&#8221; cadenas de texto con caracteres no permitidos en XML como &#8220;&#8220;, &#8220;&#038;&#8221;, &#8220;&#8216;&#8221;. Usando arrays para guardar las cadenas a reemplazar con str_replace(): function limpioCaracteresXML&#40;$cadena&#41;&#123; &#160; &#160; $search ...]]></description>
			<content:encoded><![CDATA[<p>Aquí una función php que utilizo al generar archivos XML, para &#8220;limpiar&#8221; cadenas de texto con caracteres no permitidos en XML como &#8220;<", ">&#8220;, &#8220;&#038;&#8221;, &#8220;&#8216;&#8221;. Usando arrays para guardar las cadenas a reemplazar con <strong>str_replace()</strong>:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> limpioCaracteresXML<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$search</span> &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&amp;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$replace</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;lt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&amp;gt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&amp;amp;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&amp;apos&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$final</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$search</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replace</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$final</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Un ejemplo de uso al generar el xml:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> limpioCaracteresXML<span style="color: #009900;">&#40;</span><span style="color: #000088;">$titulo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;<br />
&lt;pubDate&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;D, d M Y H:i:s O&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fecha</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/pubDate&gt;<br />
&lt;link&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> limpioCaracteresXML<span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/link&gt;<br />
&lt;description&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> limpioCaracteresXML<span style="color: #009900;">&#40;</span><span style="color: #000088;">$descripcion</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/description&gt;<br />
&lt;category&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> limpioCaracteresXML<span style="color: #009900;">&#40;</span><span style="color: #000088;">$categoria</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/category&gt;<br />
&lt;/item&gt;</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/funcion-php-reemplazar-caracteres-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Contar el número total de elementos de un array</title>
		<link>http://www.bufa.es/contar-total-elementos-array/</link>
		<comments>http://www.bufa.es/contar-total-elementos-array/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 18:26:20 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[count]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1314</guid>
		<description><![CDATA[La forma más sencilla de contar el número total de elementos que contiene un array es usar la función count() de php. Un ejemplo: $miarray = array&#40;'leon','salamanca','zamora'&#41;; echo count&#40;$miarray&#41;; // Resultado: 3]]></description>
			<content:encoded><![CDATA[<p>La forma más sencilla de contar el número total de elementos que contiene un array es usar la función <strong>count()</strong> de php.</p>
<p>Un ejemplo:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$miarray</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'leon'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'salamanca'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'zamora'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$miarray</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Resultado: 3</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/contar-total-elementos-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: encriptar emails</title>
		<link>http://www.bufa.es/php-encriptar-emails/</link>
		<comments>http://www.bufa.es/php-encriptar-emails/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 22:15:14 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[encriptar]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1293</guid>
		<description><![CDATA[Para evitar que los spammotors encuentren y capturen las direcciones de email que tengamos en nuestra web podemos usar la siguiente función php para encriptar el email en el código fuente, y de esta forma evitar que estos programas automatizados ...]]></description>
			<content:encoded><![CDATA[<p>Para evitar que los spammotors encuentren y capturen las direcciones de email que tengamos en nuestra web podemos usar la siguiente <strong>función php</strong> para <strong>encriptar</strong> el email en el código fuente, y de esta forma evitar que estos programas automatizados puedan leer y guardar las direcciones de email.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> encriptar_email<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$partes</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_split"><span style="color: #990000;">str_split</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$nuevo</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$partes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$valor</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nuevo</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&amp;#'</span><span style="color: #339933;">.</span><a href="http://www.php.net/ord"><span style="color: #990000;">ord</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$valor</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">';'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$nuevo</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">echo</span> encriptar_email<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'miemail@midominio.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>La función <strong>ord()</strong>, devuelve el valor ASCII del primer carácter de la cadena.</p>
<p>De esta forma en la parte visual de la web aparece la dirección de dominio tal cual, por ej. miemail@midominio.com<br />
Pero si vemos el código fuente, vemos que la cosa cambia <img src='http://www.bufa.es/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/php-encriptar-emails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP: calcular edad a partir de fecha de nacimiento</title>
		<link>http://www.bufa.es/calcular-edad-php/</link>
		<comments>http://www.bufa.es/calcular-edad-php/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 22:04:03 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[fecha]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1291</guid>
		<description><![CDATA[A continuación una función php para calcular la edad a partir de la fecha de nacimiento. function calcular_edad&#40;$fecha&#41;&#123; &#160; &#160; $dias = explode&#40;&#34;-&#34;, $fecha, 3&#41;; &#160; &#160; $dias = mktime&#40;0,0,0,$dias&#91;1&#93;,$dias&#91;0&#93;,$dias&#91;2&#93;&#41;; &#160; &#160; $edad = &#40;int&#41;&#40;&#40;time&#40;&#41;-$dias&#41;/31556926 &#41;; &#160; &#160; return $edad; ...]]></description>
			<content:encoded><![CDATA[<p>A continuación una función php para calcular la edad a partir de la fecha de nacimiento.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> calcular_edad<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fecha</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dias</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fecha</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dias</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mktime"><span style="color: #990000;">mktime</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$dias</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$dias</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$dias</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$edad</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #000088;">$dias</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">31556926</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$edad</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">// Formato: dd-mm-yy</span><br />
<span style="color: #b1b100;">echo</span> calcular_edad<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;01-10-1989&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Resultado: 21</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/calcular-edad-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Array de cadenas aleatorias en PHP</title>
		<link>http://www.bufa.es/array-cadenas-aleatorias-php/</link>
		<comments>http://www.bufa.es/array-cadenas-aleatorias-php/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 21:47:13 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[aleatorio]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[shuffle]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1275</guid>
		<description><![CDATA[Sencilla función php ultilizando arrays, para mostrar 1 cadena (palabra/frase/número) de forma aleatoria, de un determinado array formado por todas nuestras palabras. Por ejemplo: $anchors = array&#40;&#34;León&#34;,&#34;La Bañeza&#34;,&#34;Boñar&#34;,&#34;Astorga&#34;, &#34;Ponferrada&#34;&#41;; shuffle&#40;$anchors&#41;; $randanchor = array_rand&#40;$anchors,1&#41;; echo $anchors&#91;$randanchor&#93;;]]></description>
			<content:encoded><![CDATA[<p>Sencilla función php ultilizando arrays, para mostrar 1 cadena (palabra/frase/número) de forma aleatoria, de un determinado array formado por todas nuestras palabras.</p>
<p>Por ejemplo:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$anchors</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;León&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;La Bañeza&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Boñar&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Astorga&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ponferrada&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/shuffle"><span style="color: #990000;">shuffle</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$anchors</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$randanchor</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_rand"><span style="color: #990000;">array_rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$anchors</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$anchors</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$randanchor</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/array-cadenas-aleatorias-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

