Blog Introductions

In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services. Php Variables and its types |  Php tutorials Bestitworriors


Php Variables and its types


Php tutorials





Php Variables and its types |  Php tutorials Bestitworriors - Variables are the containers for storing data and information in itself that have different type of informations in it.Variables hold information and data but for temporary or for specific purpose.It hold information untill work done on information and data.Php support many types of variable like integer , float , string ,character etc


Some Key Points for Php variables



  1. Start with dollor ($name) sign
  2. Variables Must not start with numbers
  3. Php Variables have local and globle scope
  4. Local scope variables are declear inside of function and can't be access by outside of functions
  5. Globle Scope variables declear outside of function globally but can't access inside of function
  6. Php support almost all types

Code



< ?php

// Use
Dollar
sign($) to
initilize
the
variables

$name = "Bestitworrior";
$value1 = 10;
$value2 = 10.3;

// Show
Variables

echo
"I love this channel name is $name";
echo
"<br>"
echo
"I love this channel name is ".$name;
echo
"<br>";
echo $value1;
echo
"<br>";
echo $value2;

function
fun()
{
$value3 = 10;
// Show
Error
Can
't access globel variable
echo $value1;

echo $value3;
}
// Show
Error
Can
't access Local variable outside Functon
echo $value3;


? >









OutPut

I love this channel name is Bestitworrior
I love this channel name is Bestitworrior
10
10.3
Notice: Undefined variable: value1
10
Notice: Undefined variable: value3



I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about Php Variables and its types |  Php tutorials Bestitworriors