Solved

PHP DEFINE literal in a double quoted string

Posted on 2011-03-21
3
327 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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks all
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 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

12 Experts available now in Live!

Get 1:1 Help Now