问题
I have a form that has an input type=text and the name attribute has spaces in it.
When the form submits (it uses post) how can the spaces be retained, currently it replaces the spaces with underscores _
回答1:
Use arrays in the input names.
<input name="data[hello world]" type="text">
Then get the data in PHP using the 'data' key:
$_POST['data']['hello world']
来源:https://stackoverflow.com/questions/34464444/php-html-how-to-retain-spaces-in-form-input-names