Some $ function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ngungo
Forum Commoner
Posts: 75
Joined: Thu Jun 08, 2006 10:45 pm

Some $ function

Post by ngungo »

I forgot where I've seen this piece of code. Something I am not aware of:

Code: Select all

$foo = 100;
$bar = "something and '${foo}' more."; 

or something like that. So how does that work?
I've tried to look it up but not find any reference. Any hints would be appreciated.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Some $ function

Post by requinix »

Is it still on my clipboard? Hmm, nope.

Strings. See the "variable parsing" section.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Some $ function

Post by s.dot »

Perhaps you are talking about "variable variables"
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Cirdan
Forum Contributor
Posts: 144
Joined: Sat Nov 01, 2008 3:20 pm

Re: Some $ function

Post by Cirdan »

User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Some $ function

Post by requinix »

Most times people try to use it they're doing it for the wrong reason, but there are legitimate uses for it. It's just not something seen in many other languages so it has this "if nobody else is doing it then it must be bad" stigma.
Post Reply