<?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>PHP Tutorials Code Snippets and Php Tips &#187; ctype_digit</title>
	<atom:link href="http://readytousesolutions.com/phpblog/tag/ctype_digit/feed/" rel="self" type="application/rss+xml" />
	<link>http://readytousesolutions.com/phpblog</link>
	<description>PHP tutorials - Examples of the most useful scripts</description>
	<lastBuildDate>Thu, 23 Sep 2010 06:54:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP Tutorial : Ctype character type checking</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-ctype-character-type-checking/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-ctype-character-type-checking/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 07:38:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[character type checking]]></category>
		<category><![CDATA[check character type]]></category>
		<category><![CDATA[ctype]]></category>
		<category><![CDATA[ctype_alnum]]></category>
		<category><![CDATA[ctype_alpha]]></category>
		<category><![CDATA[ctype_cntrl]]></category>
		<category><![CDATA[ctype_digit]]></category>
		<category><![CDATA[ctype_graph]]></category>
		<category><![CDATA[ctype_lower]]></category>
		<category><![CDATA[ctype_print]]></category>
		<category><![CDATA[ctype_punct]]></category>
		<category><![CDATA[ctype_space]]></category>
		<category><![CDATA[ctype_upper]]></category>
		<category><![CDATA[ctype_xdigit]]></category>
		<category><![CDATA[php character type]]></category>
		<category><![CDATA[php ctype]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=240</guid>
		<description><![CDATA[Happy 1st June for those under 18 Yesterday I&#8217;ve found a nice function in php called ctype. And? What it does? Well, I see it as a replacement for regular expressions. PHP Ctype function checks for character type. Let&#8217;s hear &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-ctype-character-type-checking/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Happy 1st June for those under 18</p>
<p>Yesterday I&#8217;ve found a nice function in php called ctype. And? What it does? Well, I see it as a replacement for regular expressions. PHP Ctype function checks for character type. Let&#8217;s hear the chars type we can check with that nice function  :</p>
<ul>
<li>alphanumeric characters &#8211; ctype_alnum()</li>
<li>alphabetic characters      &#8211; ctype_alpha()</li>
<li>control characters           &#8211; ctype_cntrl()</li>
<li>numeric characters         &#8211; ctype_digit()</li>
<li>lowercase characters      &#8211; ctype_lower()</li>
<li>uppercase characters      &#8211; ctype_upper()</li>
<li>printable characters        &#8211; ctype_print()</li>
<li>any printable character but not whitespace or an alphanumeric &#8211; ctype_punct()</li>
<li>any printable characters but not space &#8211; ctype_graph()</li>
<li>whitespace characters    &#8211; ctype_space()</li>
<li>hexadecimal digit characters &#8211; ctype_xdigit()</li>
</ul>
<p>Ok, long list huh? but usefull. I will show you a simple example which of course can be applied for all other ctype() functions :</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpComment">//will check<span class="phpKeyword"> if </span>a character type is digit
</span>
$toCheck <span class="phpOperator">=</span> 1010;
<span class="phpKeyword">
if<span class="phpOperator">(</span></span><span class="phpFunction">ctype_digit</span><span class="phpOperator">(</span>$toCheck<span class="phpOperator">)</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="htmlText">
print </span><span class="phpString">"$toCheck is a number"</span><span class="phpText">;</span>
<span class="phpKeyword"><span class="phpOperator">}</span><span class="htmlText">else</span><span class="phpOperator">{</span></span>
<span class="htmlText">
print </span><span class="phpString">"$toCheck is NOT a number"</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-ctype-character-type-checking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

