D
D
Donald2016-02-14 18:33:29
PHP
Donald, 2016-02-14 18:33:29

What are those brackets for?

Tell me what {} are
for, for example like this

$x = "Что то";
"CREATE TABLE {$x} (id int not null auto_increment primary key, name text)";

Does this mean something or am I confused?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2016-02-14
Duck @Don_Donald

The brackets show the bounds of the interpolated variable. In this case, they can be omitted.

<?php 
$a = 'A';
$abc = 'ABC';

echo "$abc";   // ABC
echo "{$a}bc"; // Abc
echo "{$abc}"; // ABC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question