0
<?php echo $_POST["name"] ; ?> Why we need Square Bracket here ?
i wanna know why this syntax is used?
5 odpowiedzi
+ 13
Every array needs subscript as a square brackets [ ] to show the value at particular index. Since $_POST is an array, it needs square brackets.
+ 11
In form handling where you have to store values of name, email, mobile number, age, gender, passwords, about, photo etc.
All those values are held by a single array, which is either $_GET or $_POST
+ 8
Cuz internally $_POST is an array which stores all values u want to pass using post
+ 1
$_POST is an associative array. As per the language design, accessing elements of such an array is performed via the square bracket notation:
echo $_POST["key"];
0
why $_POST is an array?