<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PHP Validation Numbers Only From</title>
	<atom:link href="http://newsourcemedia.com/blog/php-validation-numbers-only-from/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Tue, 07 Feb 2012 08:42:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: fie</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/comment-page-1/#comment-759</link>
		<dc:creator>fie</dc:creator>
		<pubDate>Tue, 11 Oct 2011 16:33:32 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/#comment-759</guid>
		<description>To blindly block non-numeric characters just cast the input as an int.

$input = (int) $_GET[&#039;int&#039;];

also, +1 for ctype_digit().</description>
		<content:encoded><![CDATA[<p>To blindly block non-numeric characters just cast the input as an int.</p>
<p>$input = (int) $_GET['int'];</p>
<p>also, +1 for ctype_digit().</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kamal</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/comment-page-1/#comment-683</link>
		<dc:creator>kamal</dc:creator>
		<pubDate>Wed, 24 Aug 2011 12:53:13 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/#comment-683</guid>
		<description>I think &quot;ctype_digit&quot; this function help you ....</description>
		<content:encoded><![CDATA[<p>I think &#8220;ctype_digit&#8221; this function help you &#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drupal Steve</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/comment-page-1/#comment-625</link>
		<dc:creator>Drupal Steve</dc:creator>
		<pubDate>Mon, 04 Apr 2011 17:22:58 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/#comment-625</guid>
		<description>If you want to convert &#039;(555) 555-5555&#039; to &#039;5555555555&#039;, for example, use this:

&lt;code&gt;

$phone_number_as_string = &#039;(555) 555-5555&#039;;
// Outputs &#039;(555) 555-5555&#039;

$phone_number_as_integer = preg_replace(&quot;/[^0-9]/&quot;, &quot;&quot;, $phone_number_as_string);
// Outputs 5555555555

&lt;/code&gt;

If you want to reformat your phone number into a different string, as &#039;555-555-5555&#039;, for example, use this:

&lt;code&gt;

// Regular Expression
$phone_number_as_integer_template = &#039;/([0-9]{3})([0-9]{3})([0-9]{4})/&#039;;

// Split phone number into array of 3 parts (phone_number_fields) 1/2/3 (&#039;0&#039; is all matches)
preg_match($phone_number_as_integer_template, $phone_number_as_integer, $phone_number_fields);

// Use these three parts to re-construct the phone number (separated by dashes)
$phone_number_formatted = $phone_number_fields[1] . &#039;-&#039; . $phone_number_fields[2] . &#039;-&#039; . $phone_number_fields[3];

print $phone_number_formatted;
// Outputs &#039;555-555-5555&#039;

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>If you want to convert &#8216;(555) 555-5555&#8242; to &#8217;5555555555&#8242;, for example, use this:</p>
<p><code></p>
<p>$phone_number_as_string = '(555) 555-5555';<br />
// Outputs '(555) 555-5555'</p>
<p>$phone_number_as_integer = preg_replace("/[^0-9]/", "", $phone_number_as_string);<br />
// Outputs 5555555555</p>
<p></code></p>
<p>If you want to reformat your phone number into a different string, as &#8217;555-555-5555&#8242;, for example, use this:</p>
<p><code></p>
<p>// Regular Expression<br />
$phone_number_as_integer_template = '/([0-9]{3})([0-9]{3})([0-9]{4})/';</p>
<p>// Split phone number into array of 3 parts (phone_number_fields) 1/2/3 ('0' is all matches)<br />
preg_match($phone_number_as_integer_template, $phone_number_as_integer, $phone_number_fields);</p>
<p>// Use these three parts to re-construct the phone number (separated by dashes)<br />
$phone_number_formatted = $phone_number_fields[1] . '-' . $phone_number_fields[2] . '-' . $phone_number_fields[3];</p>
<p>print $phone_number_formatted;<br />
// Outputs '555-555-5555'</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asad</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/comment-page-1/#comment-572</link>
		<dc:creator>Asad</dc:creator>
		<pubDate>Sun, 30 Jan 2011 18:23:52 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/#comment-572</guid>
		<description>Thank very much dear it solve my great problem.</description>
		<content:encoded><![CDATA[<p>Thank very much dear it solve my great problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 232322</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/comment-page-1/#comment-489</link>
		<dc:creator>232322</dc:creator>
		<pubDate>Tue, 06 Jul 2010 12:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/#comment-489</guid>
		<description>232133</description>
		<content:encoded><![CDATA[<p>232133</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 1233333</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/comment-page-1/#comment-488</link>
		<dc:creator>1233333</dc:creator>
		<pubDate>Tue, 06 Jul 2010 12:58:26 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/#comment-488</guid>
		<description>132131</description>
		<content:encoded><![CDATA[<p>132131</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mohamed</title>
		<link>http://newsourcemedia.com/blog/php-validation-numbers-only-from/comment-page-1/#comment-129</link>
		<dc:creator>mohamed</dc:creator>
		<pubDate>Thu, 12 Feb 2009 20:49:19 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/php-validation-numbers-only-from/#comment-129</guid>
		<description>is_numeric has problem 

just input 345345e45 watch &quot;e&quot; in the middle w&#039; means power i think it accept this as an i/p of numbers

thanks.</description>
		<content:encoded><![CDATA[<p>is_numeric has problem </p>
<p>just input 345345e45 watch &quot;e&quot; in the middle w&#039; means power i think it accept this as an i/p of numbers</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
