|
Comments for: vaska20050812
| Message # 1030305: |
|
Date: 09/14/05 14:22
By: Per Persson Subject: Tip #6 I think that $var = "This is the $value of things."; is easier to read than $var = 'This is the ' . $value . ' of things.'; especially when there are a lot of short strings. However, I often prefer to mark it with braces: $var = "This is the {$value} of things."; One problem, though, is that you can only use variables inside strings. Constants and expressions are not supported. I would rather write $var = "{$num} books, \${$price} each cost \${$count*$price}."; than $var = "{$num} books, \${$price} each cost \$" . ($count*$price) . "}."; See http://www.zend.com/phorum/read.php?num=6&id=2610&loc=0&thread=2610 http://www.zend.com/phorum/read.php?num=6&id=655&loc=0&thread=655 |
Previous Message | Next Message |
| Comments: | ||
| Tip #6 | Per Persson | 09/14/05 14:22 |
| Excellent Information | Shafiq Rehman | 09/09/05 08:47 |
| Part One URL | Vaska | 08/21/05 08:52 |
| 10 Tips That Every PHP Developer Should Know, | Clement | 08/19/05 12:43 |
| Updated the article | vaaaska | 08/17/05 14:28 |
| easier to read | tof | 08/16/05 04:22 |
| from the editor | Scott | 08/15/05 15:22 |
| Error in your tut | John | 08/15/05 12:53 |
| correction... | Piotr | 08/15/05 11:44 |
| Tip 6 | Scott Reynen | 08/15/05 09:42 |
| correction... | matt | 08/15/05 02:33 |
| Very nice | Logan K. | 08/14/05 11:22 |
| WHAT?! | Jesse | 08/14/05 01:28 |
| Tip #5 | Toby | 08/13/05 17:32 |
| Few tips Jeffery Vaska should know. | root | 08/12/05 14:10 |
| "hackers" | martin sarsale | 08/12/05 11:23 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


