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

  • Home
  • SEARCH
  • 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 8227389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:06:57+00:00 2026-06-07T16:06:57+00:00

I have an large array like (simplified for convenience): Array ( [last_name] => Ricardo

  • 0

I have an large array like (simplified for convenience):

Array
(
    [last_name] => Ricardo 
    [first_name] => Montalban
    [sex] => Yes please
    [uploader_0_tmpname] => p171t8kao6qhj1132l14upe14rh1.jpg
    [uploader_0_name] => IMAG0114-1.jpg
    [uploader_0_status] => done
    [uploader_count] => 1
    [captcha_uid] => 155
)

And wish to remove all key value pairs where the key starts with uploader_ (this can be a series) and also every occurrence of captcha_uid.

I’ve seen a useful example here:
remove a key if value matches a pattern?
but I’m terrible at regular expressions. How to optimally do this? Your views are much appreciated.

  • 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-07T16:06:58+00:00Added an answer on June 7, 2026 at 4:06 pm

    You don’t need regular expressions in such a simple case. Applying the accepted answer in the other question:

    foreach( $array as $key => $value ) {
        if( strpos( $key, 'uploader_' ) === 0 ) {
            unset( $array[ $key ] );
        }
    }
    
    unset( $array[ 'captcha_uid' ] );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a large 2 dimensional array such like int myArray[10000][2]; I
I have a very large multidimensional array and I would like to sort it
I have a very large numpy array (containing up to a million elements) like
I have a large multidimensional array structured like the sample below. [ ['name' =>
I have a large multidimensional array that I would like to store into a
I have a large array and would like to find between which array values
I have a large array called data. At the 10th array position i have
I have a large multidimensional array and I basically want to drop the first
Hey. I have a very large array and I want to find the Nth
I have a very large NumPy array: a = np.array . From this array

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.