Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Pure VPN - Up to 27 Months
vgp
Updated:
Today at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
Ok lets start learning PHP
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="lionsIT" data-source="post: 1713332" data-attributes="member: 89624"><p>Hey Guys Lets learn about variables.</p><p></p><p>just think variable as a box that contain a value. lets see a example</p><p></p><p>[php]<?php</p><p></p><p>$my_variable = "elakir"; //you must use $ infront of your varaible name</p><p></p><p>/* This is another way of commenting, multilines */</p><p></p><p>/*</p><p>Now value elakiri is stored in your $my_variable</p><p>Now let see how to print out a variable</p><p>*/</p><p></p><p>echo $my_variable; //This will output elakiri</p><p> echo '<br>'; // to get a newline, any html tags can be displayed this way</p><p></p><p>//What if I do this</p><p>echo " $my_variable"; //yes it will print as it is, hope you got the idea</p><p></p><p>?>[/php] </p><p>Ok then, lets learn data types in php</p><p></p><p>[php]<?php</p><p>$my_string = "This is a String"; //Strings must be placed between double quotes</p><p>$my_int = 10; //if you want to store numbers, remeber not to use qoutes</p><p>$my_bool = TRUE; //use this way if you want to store only TRUE/FALSE (1/0)</p><p></p><p></p><p>echo $my_string;</p><p>echo '<br>';</p><p>echo $my_int;</p><p>echo '<br>'; </p><p>echo $my_bool; // this will print 1 bcos true, if false then 0</p><p></p><p></p><p>?>[/php] </p><p>Ok then thats it for today</p><p>please visit <a href="http://www.w3schools.com/php/php_variables.asp" target="_blank">http://www.w3schools.com/php/php_variables.asp</a></p><p>for more nice tutorials</p></blockquote><p></p>
[QUOTE="lionsIT, post: 1713332, member: 89624"] Hey Guys Lets learn about variables. just think variable as a box that contain a value. lets see a example [php]<?php $my_variable = "elakir"; //you must use $ infront of your varaible name /* This is another way of commenting, multilines */ /* Now value elakiri is stored in your $my_variable Now let see how to print out a variable */ echo $my_variable; //This will output elakiri echo '<br>'; // to get a newline, any html tags can be displayed this way //What if I do this echo " $my_variable"; //yes it will print as it is, hope you got the idea ?>[/php] Ok then, lets learn data types in php [php]<?php $my_string = "This is a String"; //Strings must be placed between double quotes $my_int = 10; //if you want to store numbers, remeber not to use qoutes $my_bool = TRUE; //use this way if you want to store only TRUE/FALSE (1/0) echo $my_string; echo '<br>'; echo $my_int; echo '<br>'; echo $my_bool; // this will print 1 bcos true, if false then 0 ?>[/php] Ok then thats it for today please visit [URL="http://www.w3schools.com/php/php_variables.asp"]http://www.w3schools.com/php/php_variables.asp[/URL] for more nice tutorials [/QUOTE]
Insert quotes…
Verification
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom