Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:10:43+00:00 2026-05-27T11:10:43+00:00

Disclaimer: I am completely new to PHP and MySQL/SQL. I have multiple implode() functions

  • 0

Disclaimer: I am completely new to PHP and MySQL/SQL.

I have multiple implode()functions for my arrays. I want to be able to have the arrays input into the table separated with commas to avoid confusion.

  $company_state = implode($_POST['companystate']);

The output looks like this in the table and when echo:

Company state:
ILMEMDNVOHOK

But I want it to look like this within the table:

Company state:
IL, ME, MD, NV, OH, OK

Is there any way I can get it to do this?

Here is the code for the form:

<label for="companystate[ ]">Company state:</label><br />

<input type="checkbox" name="companystate[ ]" value="AL"  /><strong>Alabama</strong><br />
<input type="checkbox" name="companystate[ ]" value="AK"  /><strong>Alaska</strong><br />
<input type="checkbox" name="companystate[ ]" value="AZ"  /><strong>Arizona</strong><br />
<input type="checkbox" name="companystate[ ]" value="AR"  /><strong>Arkansas</strong><br />
<input type="checkbox" name="companystate[ ]" value="CA"  /><strong>California</strong><br />
<input type="checkbox" name="companystate[ ]" value="CO"  /><strong>Colorado</strong><br />
<input type="checkbox" name="companystate[ ]" value="CT"  /><strong>Connecticut</strong><br />
<input type="checkbox" name="companystate[ ]" value="DE"  /><strong>Delaware</strong><br />
<input type="checkbox" name="companystate[ ]" value="DC"  /><strong>District of Columbia</strong><br />
<input type="checkbox" name="companystate[ ]" value="FL"  /><strong>Florida</strong><br />
<input type="checkbox" name="companystate[ ]" value="GA"  /><strong>Georgia</strong><br />
<input type="checkbox" name="companystate[ ]" value="HI"  /><strong>Hawaii</strong><br />
<input type="checkbox" name="companystate[ ]" value="ID"  /><strong>Idaho</strong><br />
<input type="checkbox" name="companystate[ ]" value="IL"  /><strong>Illinois</strong><br />
<input type="checkbox" name="companystate[ ]" value="IN"  /><strong>Indiana</strong><br />
<input type="checkbox" name="companystate[ ]" value="IA"  /><strong>Iowa</strong><br />
<input type="checkbox" name="companystate[ ]" value="KS"  /><strong>Kansas</strong><br />
<input type="checkbox" name="companystate[ ]" value="KY"  /><strong>Kentucky</strong><br />
<input type="checkbox" name="companystate[ ]" value="LA"  /><strong>Louisiana</strong><br />
<input type="checkbox" name="companystate[ ]" value="ME"  /><strong>Maine</strong><br />
<input type="checkbox" name="companystate[ ]" value="MD"  /><strong>Maryland</strong><br />
<input type="checkbox" name="companystate[ ]" value="MA"  /><strong>Massachusetts</strong><br />
<input type="checkbox" name="companystate[ ]" value="MI"  /><strong>Michigan</strong><br />
<input type="checkbox" name="companystate[ ]" value="MN"  /><strong>Minnesota</strong><br />
<input type="checkbox" name="companystate[ ]" value="MS"  /><strong>Mississippi</strong><br />
<input type="checkbox" name="companystate[ ]" value="MO"  /><strong>Missouri</strong><br />
<input type="checkbox" name="companystate[ ]" value="MT"  /><strong>Montana</strong><br />
<input type="checkbox" name="companystate[ ]" value="NE"  /><strong>Nebraska</strong><br />
<input type="checkbox" name="companystate[ ]" value="NV"  /><strong>Nevada</strong><br />
<input type="checkbox" name="companystate[ ]" value="NH"  /><strong>New Hampshire</strong><br />
<input type="checkbox" name="companystate[ ]" value="NJ"  /><strong>New Jersey</strong><br />
<input type="checkbox" name="companystate[ ]" value="NM"  /><strong>New Mexico</strong><br />
<input type="checkbox" name="companystate[ ]" value="NY"  /><strong>New York</strong><br />
<input type="checkbox" name="companystate[ ]" value="NC"  /><strong>North Carolina</strong><br />
<input type="checkbox" name="companystate[ ]" value="ND"  /><strong>North Dakota</strong><br />
<input type="checkbox" name="companystate[ ]" value="OH"  /><strong>Ohio</strong><br />
<input type="checkbox" name="companystate[ ]" value="OK"  /><strong>Oklahoma</strong><br />
<input type="checkbox" name="companystate[ ]" value="OR"  /><strong>Oregon</strong><br />
<input type="checkbox" name="companystate[ ]" value="PA"  /><strong>Pennsylvania</strong><br />
<input type="checkbox" name="companystate[ ]" value="RI"  /><strong>Rhode Island</strong><br />
<input type="checkbox" name="companystate[ ]" value="SC"  /><strong>South Carolina</strong><br />
<input type="checkbox" name="companystate[ ]" value="SD"  /><strong>South Dakota</strong><br />
<input type="checkbox" name="companystate[ ]" value="TN"  /><strong>Tennessee</strong><br />
<input type="checkbox" name="companystate[ ]" value="TX"  /><strong>Texas</strong><br />
<input type="checkbox" name="companystate[ ]" value="UT"  /><strong>Utah</strong><br />
<input type="checkbox" name="companystate[ ]" value="VT"  /><strong>Vermont</strong><br />
<input type="checkbox" name="companystate[ ]" value="VA"  /><strong>Virginia</strong><br />
<input type="checkbox" name="companystate[ ]" value="WA"  /><strong>Washington</strong><br />
<input type="checkbox" name="companystate[ ]" value="WV"  /><strong>West Virginia</strong><br />
<input type="checkbox" name="companystate[ ]" value="WI"  /><strong>Wisconsin</strong><br />
<input type="checkbox" name="companystate[ ]" value="WY"  /><strong>Wyoming</strong><br />

Thanks in advance. And also could you explain to me what each function does? I’m still learning and most of PHP/SQL is still gibberish to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:10:44+00:00Added an answer on May 27, 2026 at 11:10 am

    You just need to pass in some glue for your implode:

    implode(', ', $_POST['companystate']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Disclaimer: completely new to Python from a PHP background Ok I'm using Python on
Disclaimer: Never used php in my life. New to Unix and Jenkins I have
Disclaimer: I'm fairly new to python! If I want all the lines of a
Disclaimer: I'm completely new to Java EE/EJB and all that, so bear with me.
Disclaimer: I'm completely clueless about .net and COM. I have a vendor's application that
Disclaimer: I am new to python and django but have Drupal programming experience. I'm
Disclaimer: I am new to django but have coded in Drupal I need to
Disclaimer: I am new to python and django but have programmed in Drupal I
Disclaimer: I am new to python and Django, but have Drupal programming experience. I'm
Disclaimer: I am new to python and django but have experience programming in Drupal.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.