Solved

PHP DEFINE literal in a double quoted string

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wordpress Pagination 1 45
Returning errors to display in a dialog box - Ajax, Json, Php 16 53
deprecated mysql extensions 1 30
How do I remove "" from json_encode 5 22
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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.

726 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