A
A
Alexey selftrips.ru2018-01-29 11:57:11
PHP
Alexey selftrips.ru, 2018-01-29 11:57:11

How to find the name of an implicit variable?

$a='какой то текст, может вычисляться';
$$a=123;
echo $$a;

Displays 123.
And how to display the name of the variable itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasiliy_M, 2018-01-29
@Vasiliy_M

The very name of the variable you have is in the $a variable.
Here is the proof:

echo ${'какой то текст, может вычисляться'}; // выведет 123
echo $a; // какой то текст, может вычисляться

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question