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
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Yesterday at 12:26 PM
Windows RDP Only Rs.500 a month
Blogerwiki
Updated:
Sunday at 12:41 PM
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
FREE SEO Check & Google Maps Check for Sri Lankan Businesses | Web Design, Website Price Rs 14,900 |
LankaSolve
Updated:
Oct 20, 2026
ඕනම රටකට සෙට් වෙන CV එකක්
ErMurazor
Updated:
Oct 17, 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
Haya warak paha keeyada? (haya wadi kireema paha)
Post reply
Top
Bottom