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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
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 ?    13 Yes 2 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 ?    7 Yes 3 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 ?    3 Yes 4 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 ?    3 Yes 2 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 ?    5 Yes 0 No
Abhishek Baranwal
 

 
 
 
Other PHP Interview Questions
 
  Question Asked @ Answers
 
Functions in IMAP, POP3 AND LDAP? Rushmore-Consultancy1
What are the differences between require and include, include_once?  2
What is meant by content management system? Global-Logic3
does PHP support foreign key and Rollback?yes or not.if not then why. how will you done these concept in php? Avanigoradia1
how to install openssl, ISAPI, pdf modules in php 5.2.5 with apache on windows xp.  2
how long a default session stay in php?  4
how to insert logout time when browser close  1
i want simple programs in php and outputs and how to use in web developed side in php briefly explined in exmple  1
can we use PGP with PHP?  1
How do I add to the beginning of an array and find the number of elements in it? Rushmore-Consultancy1
can anyone tel me about the Expression engine Note:Its a CMS in Php  2
what are the rules to be followed at the time of declaring a variable?,what is the purpose of var_dump()function in php,syntax of ternary operator()in php,difference between drop a table and truncate a table...  2
What are different ways to redirect from on page to other?  9
How can you insert javascript in php code? TCS8
What is the functionality of the function strstr and stristr?  2
Write a regular expression to get the value xxx from the string 'xxx@yyy.com'  2
What do you mean by MVC ? NIIT2
How can we increase the execution time of a PHP script? Photon7
What is the advantge and disadvantage of mysql_connet() and mysql_pconnect() ? in which condition will you use mysql_connect() and mysql_pconnect(). Avanigoradia2
Is there a way to encrypt text from php?  4
 
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