Braces placed around variables
Posted: Wed Feb 04, 2009 2:10 pm
Hi, this is something I've seen in peoples' code before:
etc. I'm just curious as to what the braces do when placed around a variable?
As I often see them in places where the code works with or without them, I haven't been able to figure out exactly what they are for!
Code: Select all
echo "This is a number: {$number}";
//or
${number}As I often see them in places where the code works with or without them, I haven't been able to figure out exactly what they are for!