<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1019740" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1019740</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119688</link>
    <description> &lt;p&gt;Ok thanks for that..&lt;/p&gt;
 </description>
     <pubDate>Mon, 25 Nov 2002 04:48:36 +0000</pubDate>
 <dc:creator>nuk3</dc:creator>
 <guid isPermaLink="false">comment 1119688 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119608</link>
    <description> &lt;p&gt;&lt;strong&gt;$a + $a = &quot;$total&quot;;&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;$total first needs to be defined, &#039;given a value&#039;, and since it needs to be evaluated, omit the quotation marks, ie:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$a &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$total &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$a &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;+ &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$a&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$total&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
Cheers,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TonyMontana&lt;/strong&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 24 Nov 2002 06:41:08 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1119608 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119505</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
Mark, you&#039;d be an excellent teacher. Scratch that, you ARE an excellent teacher.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Yes he is a good teacher!&lt;/p&gt;
 </description>
     <pubDate>Sat, 23 Nov 2002 00:39:07 +0000</pubDate>
 <dc:creator>nuk3</dc:creator>
 <guid isPermaLink="false">comment 1119505 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119232</link>
    <description> &lt;p&gt;Mark, you&#039;d be an excellent teacher. Scratch that, you ARE an excellent teacher.&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Nov 2002 14:34:04 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1119232 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119172</link>
    <description> &lt;p&gt;Ok I think I understand it now. There are just a few new things that you are using above which I&#039;ve never seen before.. Thanks allot for your help Mark &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Nov 2002 08:45:32 +0000</pubDate>
 <dc:creator>nuk3</dc:creator>
 <guid isPermaLink="false">comment 1119172 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119170</link>
    <description> &lt;p&gt;a few comments inset...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// counters&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_right &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_wrong &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// array of questions and correct answers&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array ( \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;This Quiz is made by who?\&quot;, \&quot;Question2\&quot;, \&quot;Question3\&quot;, \&quot;Question4\&quot;, \&quot;Question5\&quot; );&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = array ( \&quot;Owen\&quot;, \&quot;Blah2\&quot;, \&quot;Blah3\&quot;, \&quot;Blah4\&quot;, \&quot;Blah5\&quot; );&lt;br /&gt;&lt;br /&gt;// init counter to zero&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=0;&lt;br /&gt;&lt;br /&gt;// loop while there is a question and answer&lt;br /&gt;while (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) &amp;amp;&amp;amp; isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // \&quot;Question 1: This Quiz is made by who?\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // \&quot;Your Answer: John Doe\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // \&quot;Correct Answer: Owen\&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Question \&quot;.(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;+1).\&quot;: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Your Answer: \&quot;.&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;q&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)}&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.\&quot;\n\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Correct Answer: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Result: \&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // IF the answer for the current question EQUALS the answer provided in the&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // form THEN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // to be even more detailed....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;q&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)}&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; is a dynamic variable&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // when on quesion 1, the valiable being accessed will be &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // when on question 2, it will be &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // etc., etc., so on, and so forth&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // when on question 5, it will be &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q5&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;q&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)}&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;You got it right!\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // increment counter for correct answers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_right&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;You got it wrong!\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // increment counter for wrong answers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_wrong&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++;&lt;br /&gt;} // loop&lt;br /&gt;&lt;br /&gt;print (\&quot;Final Results:\n\&quot;);&lt;br /&gt;print (\&quot;Total Correct: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_right&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;print (\&quot;Total Wrong: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_wrong&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;Do you have any specific quesitons?&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Nov 2002 08:39:32 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1119170 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119166</link>
    <description> &lt;p&gt;I dont understand a thing above lol&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Nov 2002 08:30:30 +0000</pubDate>
 <dc:creator>nuk3</dc:creator>
 <guid isPermaLink="false">comment 1119166 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119164</link>
    <description> &lt;p&gt;try this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$cnt_right &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_wrong &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array ( \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;This Quiz is made by who?\&quot;, \&quot;Question2\&quot;, \&quot;Question3\&quot;, \&quot;Question4\&quot;, \&quot;Question5\&quot; );&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = array ( \&quot;Owen\&quot;, \&quot;Blah2\&quot;, \&quot;Blah3\&quot;, \&quot;Blah4\&quot;, \&quot;Blah5\&quot; );&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=0;&lt;br /&gt;while (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) &amp;amp;&amp;amp; isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Question \&quot;.(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;+1).\&quot;: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Your Answer: \&quot;.&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;q&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.\&quot;\n\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Correct Answer: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Result: \&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;q&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;You got it right!\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_right&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;You got it wrong!\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_wrong&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;print (\&quot;Final Results:\n\&quot;);&lt;br /&gt;print (\&quot;Total Correct: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_right&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;print (\&quot;Total Wrong: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cnt_wrong&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\n\&quot;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Nov 2002 08:27:23 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1119164 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119161</link>
    <description> &lt;p&gt;I&#039;m creating a quiz script and I need to add up all the values that were correct. I&#039;m wondering how I would go about this.&lt;/p&gt;
&lt;p&gt;Here is the code, I know its bulky but I&#039;m still learning..&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$right &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;You got it right!\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$wrong&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;You got it wrong!\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = array ( \&quot;This Quiz is made by who?\&quot;, \&quot;Question2\&quot;, \&quot;Question3\&quot;, \&quot;Question4\&quot;, \&quot;Question5\&quot;, \&quot;Question6\&quot;, \&quot;Question7\&quot;, \&quot;Question8\&quot;, \&quot;Question9\&quot;, \&quot;Question10\&quot; );&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = array ( \&quot;Owen\&quot;, \&quot;Blah2\&quot;, \&quot;Blah3\&quot;, \&quot;Blah4\&quot;, \&quot;Blah5\&quot;, \&quot;Blah6\&quot;, \&quot;Blah7\&quot;, \&quot;Blah8\&quot;, \&quot;Blah9\&quot;, \&quot;Blah10\&quot; );&lt;br /&gt;&lt;br /&gt;print (\&quot;Question 1 :\&quot;); &lt;br /&gt;print (\&quot;Question: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$question&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;); &lt;br /&gt;print (\&quot;Your Answer: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;); &lt;br /&gt;print (\&quot;Correct Answer: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;); &lt;br /&gt;&lt;br /&gt;print (\&quot;Result: \&quot;); &lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$answer&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;) { &lt;br /&gt;print (\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$right&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;); } else {&lt;br /&gt;print (\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$wrong&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;);} &lt;br /&gt;&lt;br /&gt;print (\&quot;&amp;lt;/font&amp;gt;\&quot;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt; &lt;/p&gt;
&lt;p&gt;The $q1 variable is delivered from the option that the user selects on the previous page. I so far only have 1 question implemented. For an online demo go &lt;a href=&quot;http://silo.newezone.com/quiz.php&quot; class=&quot;bb-url&quot;&gt;HERE&lt;/a&gt;.&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Nov 2002 08:17:44 +0000</pubDate>
 <dc:creator>nuk3</dc:creator>
 <guid isPermaLink="false">comment 1119161 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-aritmetic-operators#comment-1119151</link>
    <description> &lt;p&gt;&lt;strong&gt;$a == &quot;1&quot;;&lt;/strong&gt;&lt;br /&gt;
== is a comparison opperator, not an assignment opperator&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$a + $a == &quot;$total&quot;;&lt;/strong&gt;&lt;br /&gt;
Even if we assume this was corrected to:&lt;br /&gt;
$a + $a = &quot;$total&quot;;&lt;br /&gt;
This still would not work because &lt;strong&gt;$a + $a&lt;/strong&gt; is an expression and cannot be assigned a value.&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Nov 2002 08:02:47 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1119151 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
