<?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: Problem and Solution!</title>
	<atom:link href="http://www.phpdone.com/blog/2009/11/problem-and-solution/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpdone.com/blog/2009/11/problem-and-solution/</link>
	<description>Teach Yourself PHP</description>
	<lastBuildDate>Thu, 08 Apr 2010 12:58:05 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: trixum</title>
		<link>http://www.phpdone.com/blog/2009/11/problem-and-solution/comment-page-1/#comment-10</link>
		<dc:creator>trixum</dc:creator>
		<pubDate>Fri, 25 Dec 2009 05:44:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpdone.com/blog/?p=121#comment-10</guid>
		<description>gud one</description>
		<content:encoded><![CDATA[<p>gud one</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr. Perl</title>
		<link>http://www.phpdone.com/blog/2009/11/problem-and-solution/comment-page-1/#comment-6</link>
		<dc:creator>Dr. Perl</dc:creator>
		<pubDate>Wed, 18 Nov 2009 21:23:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpdone.com/blog/?p=121#comment-6</guid>
		<description>For a reference on Arithmetic Operators, see PHP official manual entry at :

http://www.php.net/manual/en/language.operators.arithmetic.php</description>
		<content:encoded><![CDATA[<p>For a reference on Arithmetic Operators, see PHP official manual entry at :</p>
<p><a href="http://www.php.net/manual/en/language.operators.arithmetic.php" rel="nofollow">http://www.php.net/manual/en/language.operators.arithmetic.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waqas Bin Hasan</title>
		<link>http://www.phpdone.com/blog/2009/11/problem-and-solution/comment-page-1/#comment-5</link>
		<dc:creator>Waqas Bin Hasan</dc:creator>
		<pubDate>Wed, 18 Nov 2009 21:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpdone.com/blog/?p=121#comment-5</guid>
		<description>Dear Asim,

You can use modulus operator (%) also for this purpose. Change your line:

$int_var1 = ($counter/3); //current counter will be divided by 3
$int_var2 = ($counter/5); //current counter will be divided by 5

with

$int_var1 = ($counter % 3); //current counter will be divided by 3
$int_var2 = ($counter % 5); //current counter will be divided by 5

and rather checking for gettype(), you can check for the remainder, which will be returned in your variables $int_var1 and $int_var2. If remainder is 0 (zero) then it&#039;s your required number otherwise remainder will be greater than 0. 

Modulus is an arithmetic operator and much faster than type casting like you are doing with gettype() and checking on the string &quot;integer&quot;.

FYI: Type casting means converting data from one data type to another. i.e: converting a digit into string or into boolean, this is called type casting, and it always has payload.</description>
		<content:encoded><![CDATA[<p>Dear Asim,</p>
<p>You can use modulus operator (%) also for this purpose. Change your line:</p>
<p>$int_var1 = ($counter/3); //current counter will be divided by 3<br />
$int_var2 = ($counter/5); //current counter will be divided by 5</p>
<p>with</p>
<p>$int_var1 = ($counter % 3); //current counter will be divided by 3<br />
$int_var2 = ($counter % 5); //current counter will be divided by 5</p>
<p>and rather checking for gettype(), you can check for the remainder, which will be returned in your variables $int_var1 and $int_var2. If remainder is 0 (zero) then it&#8217;s your required number otherwise remainder will be greater than 0. </p>
<p>Modulus is an arithmetic operator and much faster than type casting like you are doing with gettype() and checking on the string &#8220;integer&#8221;.</p>
<p>FYI: Type casting means converting data from one data type to another. i.e: converting a digit into string or into boolean, this is called type casting, and it always has payload.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
