Thursday, June 17, 2010

PHP - Interview questions - V

PHP - Interview questions - V

Q: Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?

Ans:  In this example, since the variable is all by itself, but if you were to print something like "{$a},000,000 mln dollars", then you definitely need to use the braces.

Q; If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?


ns: 100, it’s a reference to existing variable.

No comments:

Post a Comment