PHP string Computation
<p>Im doing a php activity, that will compute the sum of given number of integer.
Sample Output:</p>

<pre><code> int number = 367;
 Final output 
 16
</code></pre>

<p>16 is the total sum of 3+6+7. </p>

<p>Here's my Code:</p>

<pre><code>$number = "367";
$int = 0;

for ($i = 0 ; $i &lt; number.length(); $i++ ){
    $char = number.charAt(i);
    $int += Integer.parseInt(char1.toString());
}
echo $int;
</code></pre>

<p>Still i can't get the right answer anyone can help me? Thank you !</p>

<p>regards jay</p>
