D
D
ds00lon2015-10-27 01:02:50
PHP
ds00lon, 2015-10-27 01:02:50

How to create a variable name from variables in php?

For example
$a = 1;
$b = 2;
$var.$a = 'Value';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2015-10-27
@ds00lon

$$a = 'Значение'; 
${$a.$b} = 'Значение';

Just keep in mind that $1 cannot be written)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question