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 9253905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:20:06+00:00 2026-06-18T11:20:06+00:00

I have a form field called $_POST[‘hidden-tags’] It has values entered in as follows

  • 0

I have a form field called $_POST['hidden-tags']

It has values entered in as follows

cars, vans, bikes, trains,

I on post im trying to split the values and save them into an array and then compare that array with another I have and only display the values that are different. I know the $arr1 has values as I have tested the data.

the code I have so far is

  $arr1;

  $arr2 = array();

foreach($_POST['hidden-tags'] as $value){
$arr2[] = explode(",",$value);  
}

print_r($arr2);

   // $tmp = array_diff_key($arr1, $arr2);
     //  echo $tmp;

parts of which I found here on stack
PHP explode array

As you can see I have the final bit commented out. This is so I can see the array values. If I echo the $arr2 all I see on screen is

Array()

even though I have entered cars, bikes, vans. I have not got as far as comparing the two array yet and displaying the $tmp variable

  • 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-06-18T11:20:08+00:00Added an answer on June 18, 2026 at 11:20 am

    Is $_POST['hidden-tags'] a text input field? If so, you don’t need to run a foreach on it to split it into an array. Just explode it and compare the generated array with the one you already have.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form I've built in PHP and storing the form field values
I have a Django form that references a model called AutoPart which has a
I have a form where i'm trying to validate that a field called birthday
I have a post model with a datetime field called published_at. On my form
In my registration form I have a field called s_id . when i will
I have a form field which requires a json object as its value when
I have a form field: web_address = forms.RegexField(regex=r'^DO SOMETHING$', error_messages = {'invalid': _(Not a
I have form where user submits field. Field can have letters, numbers, and punctuation.
I have a form with input field which can be accessed like var algorithm
I have a form with a field that does not live permanently on the

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.