I try differently:
$var["{$dir}"]; $var[$dir]; $var[(string)$dir]; ... As soon as I do not try, I constantly get an error: Notice: Undefined index: значение in ...
And if you print the $dir variable itself, then the value is output. Fantasy!
I try differently:
$var["{$dir}"]; $var[$dir]; $var[(string)$dir]; ... As soon as I do not try, I constantly get an error: Notice: Undefined index: значение in ...
And if you print the $dir variable itself, then the value is output. Fantasy!
How to insert into an array key from a variable in PHP?
As I understand it, you need to get a new array with the keys you know. If I do not understand correctly, then clarify the question and I will rewrite the answer, and if the solution is correct, here is the solution:
These actions
$var["{$dir}"]; $var[$dir]; $var[(string)$dir]; You call an element of this array using the $ dir key. If you want to add a new key to the $ var array, then indicate to it any value acceptable to you using this key, for example:
//$var["{$dir}"]=''; $var[$dir]='';//операция присвоения - мы присваиваем массиву $var //значение(пустое в данном случае - пустой символ) по ключу $dir //$var[(string)$dir]=''; print_r($var); Source: https://ru.stackoverflow.com/questions/628232/
All Articles
Array ( [kylticket] => 2.2 )- Vladimirecho rawurlencode($dir."<br>".key($updates_result));- Ipatiev