Re: Comma question
| From: | Justin French | Date: | Tue, 23 Jul 2002 04:28:45 +0000 |
| Subject: | Re: Comma question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109022@lists.php.net to get a copy of this message | ||
on 23/07/02 8:34 AM, B i g D o g (bigdog@venticon.com) wrote:
> What does the "," and "{}" do in this type of statement?
>
> Example: echo "<tr><td>{$strName}</td></tr>",
> htmlspecialchars( $teststr );
Not sure about the comma, but the {braces} are easy. They help separate the
$vars from other stuff in the string.
Example:
<?
$string = " something ";
echo "This will$somethingprobably not work";
echo "This will{$something}probably not work";
?>
It's a good habbit to get into, and has saved my arse on a few occasions,
although the above example isn't a good one.
Justin