Solved

PHP DEFINE literal in a double quoted string

Posted on 2011-03-21
3
331 Views
Last Modified: 2012-05-11
Simple $variables expand if they're in a DOUBLE quoted string
ex: "Today's Date: $DateVariable"

if i have a DEFINE literal    is there any syntax escapement to get them to expand (be replaced) in a double quoted string?

DEFINE  DAILY_MODE =1

echo "The mode value is  DAILY_MODE ";

otherwise:
echo "The mode value is ".  DAILY_MODE;

thanks
0
Comment
Question by:willsherwood
3 Comments
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 250 total points
ID: 35181333
Stick with echo "The mode value is ".  DAILY_MODE;. Variable expansion is for variables and literals are not variables
0
 
LVL 14

Assisted Solution

by:Scott Madeira
Scott Madeira earned 250 total points
ID: 35181334
Not that I am aware of or could find online.  I think you are stuck with option 2: echo "The mode value is ".  DAILY_MODE;
0
 

Author Closing Comment

by:willsherwood
ID: 35181452
thanks all
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now