نجوم مصرية
منتديات نجوم مصرية منتدى المدونين واصحاب المواقع منتدى لغات البرمجة



PHP Step by step - Variables

 

Variables are used to store data or any thing to a var.
You can put a data to your var and then using it in your program.

Let's do it

First :-
The variable can be letters or numbers and we can used _ too
but we donot start with numbers so ...
we can use vars like
[PHP] devcoder[/PHP]
[PHP] devCoder[/PHP]
[PHP] DevCoder[/PHP]
[PHP] DevCoder_50[/PHP]
not
[PHP] 50_DevCoder[/PHP]
or
[PHP] Dev Coder[/PHP]

and now we can set the value of the var like
[PHP] devCoder = 50[/PHP]

so now the variable devCoder has the value 50
So, the variable name comes first, then an equals sign. After the equals sign, you tell your variable what it will be doing. Holding the number 50, in our case.

However we are learning PHP the is something missing it's the dollar sign it used to defined the variable like
[PHP] $devCoder = 50[/PHP]
and now the is missing to ..
in PHP at the end - a semi-colon. Lines of code in PHP need a semi-colon at the end:
[PHP] $devCoder = 50;[/PHP]






now it's the true we can use the variable like that
$devCoder = 50;
if we want to see the value just called echo function
[PHP] echo $devCoder;[/PHP]
it will print "50"
now we can use any data to put it in the variable
EX:-
[PHP] $var_first = 5;
$var_second = 10 + 20 + 5;[/PHP]

By ... Dev Coder








المقال "PHP Step by step - Variables" نشر بواسطة: Google Plus   بتاريخ:
salemsh
شكككككككرا ع الموضوع
vampire0
dا ريت لو سمحت تساعدنى ده كود للمواضيع ذات صله لمدنونه بلوجر

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='related-posts'>
<b:loop values='dataost.labels' var='label'>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels_thumbs& amp;max-results=12&quot;' type='text/javascript'/>
</b:loop>
<script type='text/javascript'>
var currentposturl=&quot;<dataost.url/>&quot;;
var maxresults=9;
var relatedpoststitle=&quot;&quot;;
removeRelatedDuplicates_thumbs();
printRelatedLabels_thumbs();
</script>
</div>
<div style='margin-bottom:5px;clear:both'/>
<img border='0' src='http://2.bp.blogspot.com/-Y3adlpBwqDQ/Twx31TM0XvI/AAAAAAAACoQ/kh3cR7fgE0Y/s1600/t0esqo7n.jpg'/>
<div class='related-posts'>
<b:loop values='dataost.labels' var='label'>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels&quot;' type='text/javascript'/>
</b:loop>
<script type='text/javascript'>var maxresults=6;removeRelatedDuplicates();printRelate dLabels('<dataost.url/>');</script>
</div>
<div class='clear'/></b:if>


انا عاوز اخليه للمواضيع الشائعه مش نفس السممه يعنى اى موضوع للمدونه يظهر عشوائى ممكن اعرف اغير ايه فى ده ؟؟؟؟



اسم العضو:
سؤال عشوائي يجب الاجابة عليه

الرسالة:


رابط دائم

مواضيع مشابهة:
PHP Step by step - Addition in PHP
how to wrap the child step by step
Obama: arming the rebels in Libya is possible and put pressure on Gaddafi to step down
president Mubarak step down now , details in video


Powered by vBulletin Version 3.8.8
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd
جميع الحقوق محفوظة © nmisr.com نجوم مصرية