How are Variables Defined in PHP?

Answer Posted / muthu

Variables in PHP declared with $ symbol immediately
followed by alphabets or underscore. We can use variables
without declaring also. But if we are accessing one
variable without assigning values, then we will get warning
messages.
For example
<?php
$a=10;
if($a==2)
$b=20;
echo $b;
?>
This will throw warning messages.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of token in php?

742


Can I learn php without knowing c?

772


What is the use of is_array() and in_array()?

778


What is data type in php?

746


How many records can be stored in mysql table?

781


What is the major php security hole? How to avoid?

773


How can we enable error reporting in php?

712


How to include a file code in different files in php?

777


Why php is better?

743


Is php a low level language?

731


Explain me what are the main error types in php and how do they differ?

768


List data types in PHP?

733


What is restful api?

723


What is difference between get and post?

767


How to open standard output as a file handle?

765