<?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; validar</title>
	<atom:link href="http://www.bufa.es/tag/validar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bufa.es</link>
	<description>Recursos web en español</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:28:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Función php validar url de dominio</title>
		<link>http://www.bufa.es/funcion-validar-url/</link>
		<comments>http://www.bufa.es/funcion-validar-url/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 00:34:28 +0000</pubDate>
		<dc:creator>bufa</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[función]]></category>
		<category><![CDATA[urls]]></category>
		<category><![CDATA[validar]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=228</guid>
		<description><![CDATA[Función en php utilizando una expresión regular para validar cualquier tipo de url de dominio. 1 2 3 4 5 6 7 8 9 10 $url = &#34;http://www.bufa.es&#34;; function valida_url&#40;$url&#41;&#123; if &#40;preg_match&#40;'/^(http&#124;https&#124;ftp):\/\/([\w]*)\.([\w]*)\.(com&#124;net&#124;org&#124;biz&#124;info&#124;mobi&#124;us&#124;cc&#124;bz&#124;tv&#124;ws&#124;name&#124;co&#124;me)(\.[a-z]{1,3})?\z/i', $url&#41;&#41; &#123; echo 'dominio correcto'; &#125;else&#123; echo 'dominio ...]]></description>
			<content:encoded><![CDATA[<p>Función en php utilizando una expresión regular para validar cualquier tipo de url de dominio.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.bufa.es&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> valida_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/^(http|https|ftp):\/\/([\w]*)\.([\w]*)\.(com|net|org|biz|info|mobi|us|cc|bz|tv|ws|name|co|me)(\.[a-z]{1,3})?\z/i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'dominio correcto'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>  
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'dominio incorrecto'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Modo de uso</span>
valida_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/funcion-validar-url/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Función php validar email</title>
		<link>http://www.bufa.es/funcion-php-validar-email/</link>
		<comments>http://www.bufa.es/funcion-php-validar-email/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 23:10:27 +0000</pubDate>
		<dc:creator>bufa</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[función]]></category>
		<category><![CDATA[validar]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=123</guid>
		<description><![CDATA[La validación del campo email es quizás el más utilizado en la validación de formularios web, este código servirá para validar la dirección de correo electrónico y también para verificar los registros MX del dominio en la dirección email y ...]]></description>
			<content:encoded><![CDATA[<p>La validación del campo email es quizás el más utilizado en la validación de formularios web, este código servirá para validar la dirección de correo electrónico y también para verificar los registros MX del dominio en la dirección email y así comprovar si ese email existe.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> valida_email<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mx</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">eregi</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>   
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mx</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
      <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">split</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;@&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
      <span style="color: #b1b100;">return</span> <span style="color: #990000;">getmxrr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mxrecords</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span>  
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>   
    <span style="color: #b1b100;">else</span>  
  <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>   
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/funcion-php-validar-email/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
