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

Explain the difference between mysql_connect and mysql_pconnect?

692


Which operator is used to concatenate two strings in PHP?

777


What is meant by an associative array?

731


Explain a resource?

785


How can we check the value of a given variable is alphanumeric?

768


How to execute an sql query?

706


How cookies are transported from servers to browsers?

731


What is cookies php?

715


How can we connect to a mysql database from a php script?

778


What is difference between readonly and constant?

728


What is $_ server request_method == post?

765


How to remove leading and trailing spaces from user input values in php?

742


What is an object in php?

750


How can you compare objects in php?

689


Which cryptographic extension provide generation and verification of digital signatures?

728