ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Scripts  >>  PHP
 
 


 

 
 PHP interview questions  PHP Interview Questions
 ASP interview questions  ASP Interview Questions
 CGI Perl interview questions  CGI Perl Interview Questions
 JavaScript interview questions  JavaScript Interview Questions
 VB Script interview questions  VB Script Interview Questions
 JSP interview questions  JSP Interview Questions
 Shell Script interview questions  Shell Script Interview Questions
 Python interview questions  Python Interview Questions
 Tcl interview questions  Tcl Interview Questions
 Awk interview questions  Awk Interview Questions
 AJAX interview questions  AJAX Interview Questions
 Ruby on Rails interview questions  Ruby on Rails Interview Questions
 Scripts AllOther interview questions  Scripts AllOther Interview Questions
Question
How to Define a Constant in PHP? Is $ symbol necessary?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to Define a Constant in PHP? Is $ symbol necessary?
Answer
# 1
define("CONSTANT", "Hello world.");

echo CONSTANT;  // Outputs Hello world
 
Is This Answer Correct ?    2 Yes 0 No
Saurabh Rastogi
 
  Re: How to Define a Constant in PHP? Is $ symbol necessary?
Answer
# 2
Constant means a unchangeable value and in php we are
written in "".

"constant";

And don't need to $ sign.
 
Is This Answer Correct ?    1 Yes 0 No
Dhir
 
 
 
  Re: How to Define a Constant in PHP? Is $ symbol necessary?
Answer
# 3
define(my,60);

echo my;

output will be 60.

define(my,vaneet);

echo my;

output will be vaneet
 
Is This Answer Correct ?    0 Yes 1 No
Vaneet Badhan
 
  Re: How to Define a Constant in PHP? Is $ symbol necessary?
Answer
# 4
A Dollar($) Symbol is not necessary for displaying a
constant6 variable,
ex:
define("PAGE_SIZE","100");
echo PAGE_SIZE;
or
<?=PAGE_SIZE?>
 
Is This Answer Correct ?    0 Yes 0 No
Mahesh
 
  Re: How to Define a Constant in PHP? Is $ symbol necessary?
Answer
# 5
define("CONSTANT", "Hello world.");

echo CONSTANT;  // Outputs Hello world


define("CONSTANT", "New Value");

echo CONSTANT;  // Outputs Hello world

Means once you declair the define a constant value that 
will become every time it will not take new value or it 
will not redeclair.if you want change in value then declair 
the variables for that purpose.
 
Is This Answer Correct ?    0 Yes 0 No
Abhishek Baranwal
 

 
 
 
Other PHP Interview Questions
 
  Question Asked @ Answers
 
what are in image creating functions in php A1-Technology4
What are the Merits and De-Merits of CURL library ?  1
How can we get the browser properties using PHP?  4
Suppose your Zend engine supports the mode <? ?> Then how can u configure your PHP Zend engine to support <?PHP ?> mode ?  4
What are the current versions of apache, PHP, and mysql?  3
How can I know that a variable is a number or not using a JavaScript?  2
How do you add a joomla Template in admin panel of joomla? Please mention the steps T3-Softwares3
How to install PHP with --mcrypt and --mhash?  1
Give any ten basic functions in PHP? T3-Softwares4
How many ways we can give the output to a browser?  2
How can I find the width and height of an image resource? Rushmore-Consultancy1
when we submit any string in single inverted comma('abc') with get or post method,we will get exact string with single inverted comma('abc')by using $_REQUEST[]. But it is giving (\'abc\'). so anybody please help me to remove that slash,therefore i will get exact string...  2
To find out the current year is leap year or not which date() function we've to use.Give the syntax also  4
What is meant by nl2br()?  2
How i can integrate merchant payment get way in zen cart? in php? plz help me BA-Continnum-Solutions1
How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using regular expression of PHP?  5
How can I loop through the members of an array? Rushmore-Consultancy1
what is this error "Call to unsupported or undefined function mysql_connect();" and when you will get this?  1
what is DDL and DML?  3
How can we submit a form without a submit buttom? A1-Technology10
 
For more PHP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com