Come on come on
I gotta go perhaps you can help poor folks.
need to watch all grown up.
Come on come on
Do you understand it 100%? if not you have to go from the beginning.
no i understand it!
ok stop making fun im doing it because i have to
this is so not my thing
What value of the variable Answer will be printed when this is executed?
var Max =4, Answer = 10;
var Value = new Array(Max);
for (i=0;i<=Max;i++)
Value=i+1;
for (i=0;i<=Max;i++)
Answer +=Value;
alert (Answer);
මචන් php ඉගෙනගන්න හොද් සින්හල ටියුට්ස් ටිකක් තියෙන sites ටිකක් කියපල්ලා.ලොකු උදව්වක්.
CI and MVC programming dannawada ban???
මචන් php ඉගෙනගන්න හොද සින්හල ටියුට්ස් ටිකක් තියෙන sites ටිකක් කියපල්ලා.ලොකු උදව්වක්.

මොකද පොඩ්ඩක් මුල අල්ලගන්න විතරයි ඕනේ. ඒ ටික කට්ට කාගෙන ගොඩ දාගත්ත නම් ඊලගට උඔට සින් සින් ගාලා අල්ලගන්න පුලුවන්. 
සිංහලෙන් tutorial ගොඩක් අඩු නිසා උඔට ඉගෙන ගන්න වෙන්නේ ගොඩක් හෙමින්. මහන්සි වෙලා මුල ටික අල්ලගනින්. සිංහලෙන්ම ඉගෙන ගන්න ඔිනම නම් ඉතින් සිංහල tutorial හොයනවට වඩා හොදයි කාගෙන් හරි අහගන්න එක. 
ඒත් ඉතින් තනියෙන් දෙයක් හොයන්න ගියාම අමාරුයි. programming කියන්නේ english නෙවෙයි. 

okay fine but keep in your mind you will never be productive if you go like this way forever. if you have spare time try to learn programming properly. if you have any questions make them on Yahoo Answers or on here.
I will then boost the tutorial.
declare 2 variables and assign 4 to MAX variableCode:var Max =4, Answer = 10;
and assign 10 to Answer variable.
declare an array and specify its size. so in this case the array's size isCode:var Value = new Array(Max);
4 (cause it uses variable MAX and variable max is 4).
then store the newly made array inside the value array variable.
if the FOR clause has just one line you DO NOT need to useCode:for (i=0;i<=Max;i++)
{} curly brackets. what you here do
declare and initialize the i variable and assign 0 to it.
then specify the RANGE. so in this case the RANGE is
i <= MAX. since the MAX variable is 4
it means.
i <= 4
then specify the increment or decrement value. in this case
i++ means i increase by 1 itself. so if the i value is 0 in the next iteration
i is 1 cause it increases itself.
in the first iteration i is 0 soCode:Value[i]=i+1;
so i+ 1 means 0+1 = 1
so answer is 1 which is then stored in the Value Array's 0 POSITION.
(remember still 1 is 0)
so it goes like this way for 5 iterations.
1 iteration
Value[0]= 0 +1;
2 iteration
Value[1]= 1 +1;
3 iteration
Value[2]= 2 +1;
4 iteration
Value[3]= 3 +1;
5 iteration
Value[4]= 4 +1;
4<=4
(TRUE)
6 Iteration
=> in this phase the FOR loop stops looping itself since the range is fulfilled.
you see if the i is 5
5<=4
this statement returns false. when the condition is false FOR loop doesn't execute the codes within its brackets {}.
SO THE FOR LOOP executes as long as the Condition (Range) returns TRUE.
this is same as the above example.Code:for (i=0;i<=Max;i++)
so no need for additional explanation.
in this case, += meansCode:Answer +=Value[i];
ANSWER = ANSWER + Value so when it makes short
you can write like this way
Answer +=Value;
in the first iteration.
ANSWER variable is 10, i is 0
the VALUE array holds 4 VALUES
those are 1,2,3,4,5
VALUE[0] is 1
VALUE[1] is 2
VALUE[2] is 3
VALUE[3] is 4
VALUE[4] is 5
ANSWER = ANSWER + Value
ANSWER = 10 + 1
ANSWER = 11 + 2
ANSWER = 13 + 3
ANSWER = 16 + 4
ANSWER = 20 + 5
what alert function does. display a dialog box. and it takes 1 argument.Code:alert (Answer);
it's string typed used to specify the BODY text of its DIALOG BOX.
so in this case the argument of alert function is ANSWER variable.
the ALERT will display the VALUE inside the ANSWER variable which is 25.


මෙච්චර මහන්සි වෙලා අපේ යාලුවන්ට කියල දෙනවට ගොඩක් ස්තූතියි...![]()
<?php
function add_some_extra(&$string)
{
$string .= 'and something extra.';
}
$str = 'This is a string, ';
add_some_extra($str);
echo $str; // outputs 'This is a string, and something extra.'
?>
Pass by reference, function eka atuledi karana wenas kam pass karana original variable ekata sidda wenawa.කවුරු හරි දන්නවද &$ දාන එකෙන් මොකක්ද වෙන්නේ කියලා??
PHP:<?php function add_some_extra(&$string) { $string .= 'and something extra.'; } $str = 'This is a string, '; add_some_extra($str); echo $str; // outputs 'This is a string, and something extra.' ?>
Pass by reference, function eka atuledi karana wenas kam pass karana original variable ekata sidda wenawa.