-1
I have a variable nome
, and a array
.
How to put this variable in array
? Example:
['dia'].$nome;
When I do this, returns error.
The array
dia
contains a string
, as an example: "Domingo"
, and nome
the value 1
.
Code: $name = '-bla'; $test. $_FILES['file'].= $name;
the array returns : Array ( [name] => A91126.pdf [type] => application/pdf [tmp_name] => C: xampp tmp php3BA0.tmp [error] => 0 [size] => 21710 )
Put more details in your question, especially why you want to do this.
– Wictor Chaves
First we need to understand what you want, the question is very vague. First of all you need to know clearly what you want to do and communicate this so that we can see how to do it in code. In fact this code makes no sense and we can’t even guess the intention for it.
– Maniero
Simple I want to add a value of a variable in the array. Prem concatenating the array plus the error variable
– Inicianteee
It was understood that you cannot assign a value to an array, but you have not clearly explained the purpose of this code, or you just want to know how to assign the value of any variable to an index of an array?
– Wictor Chaves
That’s right I’d like to print what’s in the array along with the variable
– Inicianteee
Dear colleague, @Beginnerteee. Make a brief community tour to understand some features. Notice that I made an edition in your question formatting the code and etc, soon you made an edition that, besides adding content - which is super welcome -, broke part of the formatting I did. Just take a look in those reviews. Hugging! ;)
– LipESprY