jquery - Put the value of every field with the same name attribute into an array using PHP -
this question has answer here:
- array string php? 10 answers
i have 2 fields (at minimum) both have same name attribute. using little jquery, user can add more text boxes using jquery's .clone()
feature. every possible input add have same name attribute first two. want try use php create comma separated list of every input value after form submitted.
$competitor_names = $_post['competitor-name']; $competitorlist = ''; foreach($competitor_names $competitorlist) { $competitorlist = $competitorlist.', '; }
the function implode()
seems you're looking :
$competitor_names = $_post['competitor-name']; $competitorlist = implode(',', $competitor_names);
Comments
Post a Comment