Solved

PHP DEFINE literal in a double quoted string

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

808 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