Jump to content

'{$id'}' confused


robert_gsfame

Recommended Posts

This is actually a PHP question.

 

PHP has several different ways in which you can specify strings: single quotes, double quotes, HEREDOC, and one other I think.

 

When using double-quoted or HEREDOC strings, you can use curly brackets as a shortcut to string concatenation.

 

<?php

$somevar = 'Fred';

echo 'Hello, ' . $somevar . "\n";
echo "Hello, " . $somevar . "\n";
echo "Hello, {$somevar}\n";

?>

 

Those should all produce the same thing.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.