Solved

PHP DEFINE literal in a double quoted string

Posted on 2011-03-21
3
333 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

16 Experts available now in Live!

Get 1:1 Help Now