Muhammad Muazzam Muhammad Muazzam - 5 months ago 18
PHP Question

Input field name syntax

I have got code from a website as:

<input type="text" class="username" name="f[username]" />


While when I want to get form value in php as

echo $_POST["f[username]"];


It shows nothing

Answer

While when I want to get form value in php as

echo $_POST["f[username]"];

Well that's not how you get it.

echo $_POST["f"]["username"];