<?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; Usefull PHP</title>
	<atom:link href="http://readytousesolutions.com/phpblog/category/usefull-php/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 : Validate email address &#8211; simple way with filter_var() function</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-validate-email-address-simple-way-with-filter_var-function/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-validate-email-address-simple-way-with-filter_var-function/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 07:39:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[php filter_var() function]]></category>
		<category><![CDATA[php validate email address]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=337</guid>
		<description><![CDATA[While browsing php.net without any scope I discovered a very cute &#38; nice way to replace the usual regular expression email checking thing. That way is via filter_var() php function which does the things 10 times faster : &#60;?php $email &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-validate-email-address-simple-way-with-filter_var-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While browsing php.net without any scope I discovered a very cute &amp; nice way to replace the usual regular expression email checking thing.</p>
<p>That way is via filter_var() php function which does the things 10 times faster :</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
$email <span class="phpOperator">=</span> <span class="phpString">"someone@example.com"</span><span class="phpText">;</span>
<span class="phpKeyword">
if </span><span class="phpOperator">(</span><span class="phpOperator">!</span><span class="phpFunction">filter_var</span><span class="phpOperator">(</span>$email, FILTER_VALIDATE_EMAIL<span class="phpOperator">)</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpFunction">echo</span> <span class="phpString">"Invalid email address"</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-validate-email-address-simple-way-with-filter_var-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial : Write text and convert into image</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-write-text-and-convert-into-image/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-write-text-and-convert-into-image/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 05:07:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[php convert text into image]]></category>
		<category><![CDATA[php email to image]]></category>
		<category><![CDATA[php merge text into image]]></category>
		<category><![CDATA[php write text to an image]]></category>
		<category><![CDATA[php write to image]]></category>
		<category><![CDATA[Write text and convert into image]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=328</guid>
		<description><![CDATA[The base usage in my mind when I write this tutorial to convert text into image with php is to write email into images dinamically to avoid spammers collecting such addresses from the internet. To run such a script you &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-write-text-and-convert-into-image/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The base usage in my mind when I write this tutorial to convert text into image with php is to write email into images dinamically to avoid spammers collecting such addresses from the internet.</p>
<p>To run such a script you must have GD library installed. We&#8217;ll take parametres via GET and merge into image:</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpKeyword">
if<span class="phpOperator">(</span></span><span class="phpOperator">!</span><span class="phpFunction">isset</span><span class="phpOperator">(</span><span class="phpScriptVar">$_GET</span><span class="phpOperator">[</span><span class="phpString">'text'</span><span class="phpOperator">]</span><span class="phpOperator">)</span><span class="phpOperator">)</span>
<span class="phpOperator">{</span>
<span class="phpFunction">die</span><span class="phpOperator">(</span><span class="phpString">"No text provided"</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpFunction">header</span> <span class="phpOperator">(</span><span class="phpString">"Content-type<span class="phpOperator">:</span> image/png"</span><span class="phpOperator">)</span><span class="phpText">;</span>
$textToConvert <span class="phpOperator">=</span> <span class="phpScriptVar">$_GET</span><span class="phpOperator">[</span><span class="phpString">'text'</span><span class="phpOperator">]</span><span class="phpText">;</span>
$font   <span class="phpOperator">=</span> <span class="phpNumber">4</span><span class="phpText">;</span>
$width  <span class="phpOperator">=</span><span class="htmlText"> ImageFontWidth</span><span class="phpOperator">(</span>$font<span class="phpOperator">)</span> * <span class="phpFunction">strlen</span><span class="phpOperator">(</span>$textToConvert<span class="phpOperator">)</span><span class="phpText">;</span>
$height <span class="phpOperator">=</span><span class="htmlText"> ImageFontHeight</span><span class="phpOperator">(</span>$font<span class="phpOperator">)</span><span class="phpText">;</span>
$im <span class="phpOperator">=</span> @<span class="phpFunction">imagecreate</span> <span class="phpOperator">(</span>$width,$height<span class="phpOperator">)</span><span class="phpText">;</span>
$background_color <span class="phpOperator">=</span> <span class="phpFunction">imagecolorallocate</span> <span class="phpOperator">(</span>$im, 255, 255, 255<span class="phpOperator">)</span><span class="phpText">;</span> <span class="phpComment">//this means it&#039;s white bg
</span>$text_color <span class="phpOperator">=</span> <span class="phpFunction">imagecolorallocate</span> <span class="phpOperator">(</span>$im, <span class="phpNumber">0</span>, <span class="phpNumber">0</span>,0<span class="phpOperator">)</span><span class="phpText">;</span><span class="phpComment">//and of course black text
</span><span class="phpFunction">imagestring</span> <span class="phpOperator">(</span>$im, $font, <span class="phpNumber">0</span>, <span class="phpNumber">0</span>,  $textToConvert, $text_color<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">imagepng</span> <span class="phpOperator">(</span>$im<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>Save this as textToImage.php and then when you want to create the image and read text do it like :</p>
<pre class="html">
<span class="htmlImageTag">&lt;img src=<span class="htmlAttributeValue">&quot;textToImage.php?text=emailAddress@emailProvider.com&quot;</span>&gt;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-write-text-and-convert-into-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial : Get Browser Name &amp; It&#8217;s Capabilities</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-get-browser-name-its-capabilities/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-get-browser-name-its-capabilities/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 05:34:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[php browser name]]></category>
		<category><![CDATA[php detect visitor browser]]></category>
		<category><![CDATA[php get browser]]></category>
		<category><![CDATA[php get browser capabilities]]></category>
		<category><![CDATA[php get user browser]]></category>
		<category><![CDATA[php get user browser name]]></category>
		<category><![CDATA[php get_browser]]></category>
		<category><![CDATA[php get_browser() function]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=326</guid>
		<description><![CDATA[To get browser name just use next thing : &#60;?php print $_SERVER['HTTP_USER_AGENT']; ?&#62; And for all the features of browser user : &#60;?php print_r(get_browser(null, true));//null for user agent &#038;amp; true to return array ?&#62;]]></description>
			<content:encoded><![CDATA[<p>To get browser name just use next thing :</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpFunction">print</span> <span class="phpScriptVar">$_SERVER</span><span class="phpOperator">[</span><span class="phpString">'HTTP_USER_AGENT'</span><span class="phpOperator">]</span><span class="phpText">;</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>And for all the features of browser user :</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpFunction">print_r</span><span class="phpOperator">(</span><span class="phpFunction">get_browser</span><span class="phpOperator">(</span>null,<span class="phpKeyword"> true<span class="phpOperator">)</span></span><span class="phpOperator">)</span><span class="phpText">;</span><span class="phpComment">//null<span class="phpKeyword"> for </span>user agent &#038;amp<span class="phpText">;</span><span class="phpKeyword"> true </span><span class="htmlText">to</span><span class="phpKeyword"> return </span>array
</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-get-browser-name-its-capabilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial : Country list array</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-country-list-array/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-country-list-array/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 07:21:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[countries array]]></category>
		<category><![CDATA[country array]]></category>
		<category><![CDATA[php countries]]></category>
		<category><![CDATA[php countries array]]></category>
		<category><![CDATA[php country array]]></category>
		<category><![CDATA[php country drop down]]></category>
		<category><![CDATA[php country list]]></category>
		<category><![CDATA[php country list array]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=304</guid>
		<description><![CDATA[In my point of view, a very usefull and common thing we need when we build for example a membership site it&#8217;s country list array. I will do it within next function then will show how to use it : &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-country-list-array/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my point of view, a very usefull and common thing we need when we build for example a membership site it&#8217;s country list array. I will do it within next function then will show how to use it :</p>
<p><a href="http://www.crivionweb.com/countryList.phps">Click here to get the function</a></p>
<p>And here&#8217;s how to use it for example to generate a select (drop down) with options to list countries:</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
$countryList <span class="phpOperator">=</span><span class="htmlText"> countryArray</span><span class="phpOperator">(</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="htmlText">
print </span><span class="phpString">"<span class="phpOperator">&lt;</span>select name=\"</span>countryList\<span class="phpString">"<span class="phpOperator">&gt;</span>"</span><span class="phpText">;</span>
<span class="phpKeyword">
foreach<span class="phpOperator">(</span></span>$countryList<span class="phpKeyword"> as </span>$simbol <span class="phpOperator"><span class="phpOperator">=</span><span class="phpOperator">&gt;</span></span> $country<span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="htmlText">
print </span><span class="phpString">"<span class="phpOperator">&lt;</span>option value=\"</span>$simbol\<span class="phpString">"<span class="phpOperator">&gt;</span>$country<span class="phpOperator">&lt;</span>/option<span class="phpOperator">&gt;</span>\n"</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="htmlText">
print </span><span class="phpString">"<span class="phpOperator">&lt;</span>/select<span class="phpOperator">&gt;</span>"</span><span class="phpText">;</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>Simply usefull!</p>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-country-list-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial : List function</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-list-function/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-list-function/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 05:14:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[assign variables]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[php convert string into variable]]></category>
		<category><![CDATA[php list]]></category>
		<category><![CDATA[php list function]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=298</guid>
		<description><![CDATA[Beeing surprised that I didn&#8217;t write here about this &#8220;cute&#8221; php function called list(). I like it a lot, it&#8217;s like the extract() function in some way if you remember. The list() php function will assign variables in one shot &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-list-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Beeing surprised that I didn&#8217;t write here about this &#8220;cute&#8221; php function called list(). I like it a lot, it&#8217;s like the extract() function in some way if you remember.</p>
<p>The list() php function will assign variables in one shot to strings from arrays.</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpComment">//here&#039;s the php <span class="phpFunction">array</span>
</span>
$countingArray <span class="phpOperator">=</span> <span class="phpFunction">array</span><span class="phpOperator">(</span><span class="phpNumber">1</span>,2,<span class="phpNumber">3</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpComment">//here, the <span class="phpFunction">list</span> <span class="phpFunctionKeyword">function</span><span class="htmlText"> will convert </span><span class="phpNumber">1</span> to $one variable, <span class="phpNumber">2</span> to $two and <span class="phpNumber">3</span> to $three
</span>
<span class="phpFunction">list</span><span class="phpOperator">(</span><span class="phpString">"one"</span>, <span class="phpString">"two"</span>, <span class="phpString">"three"</span><span class="phpOperator">)</span> <span class="phpOperator">=</span> $countingArray<span class="phpText">;</span>
<span class="htmlText">
print </span><span class="phpString">"I am counting $one, errr I think it comes $two, and lastly $three"</span><span class="phpText">;</span>
<span class="phpComment">//should print I am counting <span class="phpNumber">1</span>, err.<span class="phpOperator">.</span>.<span class="phpOperator">.</span><span class="htmlText">comes </span><span class="phpNumber">2</span><span class="htmlText"> and lastly </span><span class="phpNumber">3</span>
</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-list-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial : Get Protocol</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-get-protocol/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-get-protocol/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:10:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[detect protocol]]></category>
		<category><![CDATA[get protocol]]></category>
		<category><![CDATA[php detect protocol]]></category>
		<category><![CDATA[php get protocol]]></category>
		<category><![CDATA[php protocol]]></category>
		<category><![CDATA[protocol]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=246</guid>
		<description><![CDATA[I saw this problem/question on a few forums and I finded it useful to post on my blog too due to low results on google that gives you what you need. So,  how to get the protocol of a URL &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-get-protocol/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I saw this problem/question on a few forums and I finded it useful to post on my blog too due to low results on google that gives you what you need. So,  how to get the protocol of a URL using php?  Have a look :</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
$protocol <span class="phpOperator">=</span> <span class="phpFunction">strtolower</span><span class="phpOperator">(</span><span class="phpFunction">substr</span><span class="phpOperator">(</span><span class="phpScriptVar">$_SERVER</span><span class="phpOperator">[</span><span class="phpString">"SERVER_PROTOCOL"</span><span class="phpOperator">]</span>,<span class="phpNumber">0</span>,5<span class="phpOperator">)</span><span class="phpOperator">)</span><span class="phpOperator"><span class="phpOperator">=</span>=</span><span class="phpString">'https'</span><span class="phpOperator">?</span><span class="phpString">'https'</span><span class="phpOperator">:</span><span class="phpString">'http'</span><span class="phpText">;</span>
<span class="htmlText">
print </span><span class="phpString">"The protocol is $protocol"</span><span class="phpText">;</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>Tadaaa!</p>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-get-protocol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
		<item>
		<title>PHP Tutorial : Get line number</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-get-line-number/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-get-line-number/#comments</comments>
		<pubDate>Sun, 31 May 2009 06:17:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[built-in constant]]></category>
		<category><![CDATA[php constants]]></category>
		<category><![CDATA[php get line number]]></category>
		<category><![CDATA[php line number]]></category>
		<category><![CDATA[_LINE_]]></category>
		<category><![CDATA[_LINE_ already defined constant]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=236</guid>
		<description><![CDATA[As you might know, PHP Server comes with built-in / already defined constants. Today I&#8217;ve been discovering a nice one which gets the line number in a file for you. This may be very usefull in a lot of cases, &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-get-line-number/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As you might know, PHP Server comes with built-in / already defined constants. Today I&#8217;ve been discovering a nice one which gets the line number in a file for you. This may be very usefull in a lot of cases, like a custom error system, debugging and not only. That CONSTANT is called simply _LINE_</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="htmlText">
print </span><span class="phpConstant">__LINE__</span><span class="phpText">;</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>This will print 3, because it&#8217;s line two!</p>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-get-line-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial : Extract function</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-extract-function/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-extract-function/#comments</comments>
		<pubDate>Thu, 14 May 2009 06:54:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[array keys to variables]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[php extract]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=211</guid>
		<description><![CDATA[A shame for me but I must tell you this function called extract() simply rocks : it will extract &#8220;keys&#8221; from an array and convert them into variables, so no more needed to manually declare variables for validation purposes from &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-extract-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A shame for me but I must tell you this function called extract() simply rocks : it will extract &#8220;keys&#8221; from an array and convert them into variables, so no more needed to manually declare variables for validation purposes from forms.</p>
<pre class="php">
<span class="htmlFormTag">&lt;form action=<span class="htmlAttributeValue">&quot;&quot;</span> method=<span class="htmlAttributeValue">&quot;post&quot;</span>&gt;</span>
name <span class="htmlFormTag">&lt;input type=<span class="htmlAttributeValue">&quot;text&quot;</span> name=<span class="htmlAttributeValue">&quot;name&quot;</span>&gt;</span><span class="htmlOtherTag">&lt;br/&gt;</span>
email <span class="htmlFormTag">&lt;input type=<span class="htmlAttributeValue">&quot;text&quot;</span> name=<span class="htmlAttributeValue">&quot;email&quot;</span>&gt;</span><span class="htmlOtherTag">&lt;br/&gt;</span>
<span class="htmlFormTag">&lt;input type=<span class="htmlAttributeValue">&quot;submit&quot;</span> name=<span class="htmlAttributeValue">&quot;sb&quot;</span> id=<span class="htmlAttributeValue">&quot;sb&quot;</span> value=<span class="htmlAttributeValue">&quot;go&quot;</span>&gt;</span>
<span class="htmlFormTag">&lt;/form&gt;</span>
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpKeyword">
if<span class="phpOperator">(</span></span><span class="phpFunction">isset</span><span class="phpOperator">(</span><span class="phpScriptVar">$_POST</span><span class="phpOperator">[</span><span class="phpString">'sb'</span><span class="phpOperator">]</span><span class="phpOperator">)</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpFunction">extract</span><span class="phpOperator">(</span><span class="phpScriptVar">$_POST</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
if<span class="phpOperator">(</span></span><span class="phpFunction">empty</span><span class="phpOperator">(</span>$name<span class="phpOperator">)</span> <span class="phpOperator">|</span><span class="phpOperator">|</span> <span class="phpFunction">empty</span><span class="phpOperator">(</span>$email<span class="phpOperator">)</span><span class="phpOperator">)</span> <span class="phpFunction">die</span><span class="phpOperator">(</span><span class="phpString">"email and name emtpy"</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="htmlText">
print </span><span class="phpString">"Name is $name and email is $email now<span class="phpOperator">!</span>"</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-extract-function/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial : Create a RSS / XMLS Feed</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-create-a-rss-xmls-feed/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-create-a-rss-xmls-feed/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 06:37:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Usefull PHP]]></category>
		<category><![CDATA[dynamic feed]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[php dynamic feed]]></category>
		<category><![CDATA[php dynamic rss xml feed]]></category>
		<category><![CDATA[php feed]]></category>
		<category><![CDATA[php feed header]]></category>
		<category><![CDATA[php header]]></category>
		<category><![CDATA[php rss xml feed]]></category>
		<category><![CDATA[php xml feed]]></category>
		<category><![CDATA[rss feed]]></category>
		<category><![CDATA[rss header]]></category>
		<category><![CDATA[rss xml feed]]></category>
		<category><![CDATA[xml feed]]></category>
		<category><![CDATA[xml header]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=172</guid>
		<description><![CDATA[Welcome, In this tutorial I will show you how to create a basic rss / xml feed with php. Basically, if you know how to create a feed in notepad, wordpad or whatever text editor, this will be easy. The &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-create-a-rss-xmls-feed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Welcome,</p>
<p>In this tutorial I will show you how to create a basic rss / xml feed with php. Basically, if you know how to create a feed in notepad, wordpad or whatever text editor, this will be easy. The difference between creating a php xml / rss feed and a &#8220;normal&#8221; one it&#8217;s that you can do this feed dinamyc later, by extracting feed elements from a database such as MySQL.</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
$XMLoutput <span class="phpOperator">=</span> <span class="phpString">"<span class="phpOperator">&lt;</span><span class="phpOperator">?</span><span class="htmlText">xml version</span><span class="phpOperator">=</span>\"</span><span class="phpNumber">1</span><span class="phpOperator">.</span><span class="phpNumber">0</span>\&quot;<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
<span class="htmlOtherTag">&lt;rss version=\&quot;2.0\&quot;&gt;</span>
<span class="htmlOtherTag">&lt;channel&gt;</span>
<span class="htmlOtherTag">&lt;title&gt;</span>PHP RSS XML FEED<span class="htmlOtherTag">&lt;/title&gt;</span>
<span class="htmlOtherTag">&lt;link&gt;</span>http://www.exampledomain.com/RSS-XML-FEED.php<span class="htmlOtherTag">&lt;/link&gt;</span>
<span class="htmlOtherTag">&lt;description&gt;</span>RSS Feed Description<span class="htmlOtherTag">&lt;/description&gt;</span>
<span class="htmlOtherTag">&lt;language&gt;</span>en-us<span class="htmlOtherTag">&lt;/language&gt;</span>
<span class="htmlOtherTag">&lt;pubDate&gt;</span>dd/mm/yy<span class="htmlOtherTag">&lt;/pubDate&gt;</span>
<span class="htmlOtherTag">&lt;lastBuildDate&gt;</span>dd/mm/yy<span class="htmlOtherTag">&lt;/lastBuildDate&gt;</span>
&quot;;
$XMLoutput .= &quot; <span class="htmlOtherTag">&lt;item&gt;</span>
<span class="htmlOtherTag">&lt;title&gt;</span>A title here<span class="htmlOtherTag">&lt;/title&gt;</span>
<span class="htmlOtherTag">&lt;link&gt;</span>Some link here<span class="htmlOtherTag">&lt;/link&gt;</span>
<span class="htmlOtherTag">&lt;description&gt;</span>description goes here<span class="htmlOtherTag">&lt;/description&gt;</span>
<span class="htmlOtherTag">&lt;/item&gt;</span>&quot;;
$XMLoutput .= &quot;<span class="htmlOtherTag">&lt;/channel&gt;</span><span class="htmlOtherTag">&lt;/rss&gt;</span>&quot;;
header(&quot;Content-Type: application/rss+xml&quot;);
print $XMLoutput;
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-create-a-rss-xmls-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

