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 csrf token and why it is required?

530


Code to upload a file in PHP?

551


What is get method in java?

521


Which operator is used to concatenate two strings in PHP?

536


iam mca post graduate in 2010 not getting job in JAVA so iam looking for carear in php as market demand is high so it is best option to try for php or not

1447






Is nan in javascript?

512


What is the integer?

563


How can we change the value of a constant?

533


Which php mvc framework is best?

553


What is a PHP Filter?

608


How we get ip address of client, previous reference page etc?

552


What are the advantages of indexes in php?

558


What is the difference between characters 34 and x34?

542


What is the difference between runtime exception and compile time exception?

535


List functions available to sort an php array?

536