Chapter 2: Using Variables In PHP

1.Variable Definition

Variable ஆனது data க்களை சேகரித்து வைத்து பின் பெறுவதற்கு பயன்படுத்தப்படுகிறது.

2.Defining Variables

பொதுவாக Variable தொடக்கம் $ கொண்டு தொடங்கும். இவை CASE SENSITIVE கிடையாது.

<?php

$FirstName = "Kamal";
$Mobile_Number = "9876543210";

echo $FirstName."<br/>".$Mobile_Number;

?>
Output
Kamal
9876543210

3.Data Types

Variables பொதுவாக DATA TYPES சார்ந்து இருப்பதில்லை.
<?php
$code = 10; // int type
$code = "adc10" // string type
$code = 10.5 // float type
$code = TRUE // boolean type
$code = NULL // null type
?>

ஒரே VARIABLE ஐ INTEGER ஆகவோ அல்லது STRING ஆகவோ மாற்றிக்கொள்ளலாம்.