Learn PHP for new users. I have a few questions about Arrays. I hope you can give me some advice.
". $ _ POST ['xh'] [$ I]."What does this sentence mean? Why should I add "[" xh "]"? Two
"."What does it mean?
Why does $ XH get an array after submission? Isn't the array () function used to create an array?
Reply to discussion (solution)
Is a string connection operation.
Why should I use html arrays like name = 'xh [] '?
Reference
Http://php.net/manual/zh/faq.html.php#faq.html.arrays
In fact, this is the case when the browser posts the past data (located below the http header)
Xh [] = first value & xh [] = second value
Php will resolve
$ _ POST ['xh'] = array (
0 => 'first value ',
1 => 'second value'
)
Therefore, $ _ POST ['xh'] [0] will obtain the 'first value'
Normally (no form array is used)
Browser end
After the POST is sent to the server, php will parse it
$ _ POST ['xh'] = 0;
Here. it does not work. for example, the first floor is the operator that connects strings. "A". "B" = "AB"
Is a string connection operation.
Not very understandable... If it is a reference, isn't it necessary to add a. in front of the variable? Why should I add a. after the front and the back? if I remove the later one, an error is returned ..
echo "";
Echo is followed by three strings (double quotation marks are red below)
The first one is :" The third is: "'>"
I am not used to concatenate strings in this way and use printf or sprintf functions similar to c.
printf("", $_POST['xh'][$i] );
echo "";
Echo is followed by three strings (double quotation marks are red below)
The first one is :" The third is: "'>"
I am not used to concatenate strings in this way and use printf or sprintf functions similar to c.
printf("", $_POST['xh'][$i] );
Well, I have understood the code more recently ..
Thank you ~~