Home >Backend Development >PHP Problem >How to convert php array to comma separation

How to convert php array to comma separation

藏色散人
藏色散人Original
2020-09-29 09:54:233312browse

How to convert php array to comma separation: First create a PHP sample file; then use the "implode(",", $_POST['gouwutype']);" method to convert the array to comma separation The string can be.

How to convert php array to comma separation

Recommendation: "PHP Video Tutorial"

php array to comma separated string

Solution:

If $_POST['gouwutype'] is an array array('lastname', 'email', 'phone');

if(isset($_POST['gouwutype'])){
$gouwutype = implode(",", $_POST['gouwutype']);//结果'lastname,email,phone'
}

The above is the detailed content of How to convert php array to comma separation. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn