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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:20:09+00:00 2026-05-26T18:20:09+00:00

I’m having an issue unsetting my parent if I do not find my needle

  • 0

I’m having an issue unsetting my parent if I do not find my needle in my child, for some reason I just cannot get this to work no matter how many different ways I try it, could someone possibly point me in the right direction? This is being thrown at a multidimensional array with a floor depth of about 4. Here’s the code and an example of what a slice of the array might look like. In this case only Array[3] should remain, Array’s [1-2] should be removed.

array (
  1 => 
  array (
    197015 => 
    array (
      345415 => 
      array (
        'options' => 
        array (
          'Name on Credential' => '',
          'Ordination Month' => '',
          'Ordination Day' => '',
          'Ordination Year' => '',
          'Badge Choice?' => '',
        ),
        'comments' => 
        array (
          213354 => '',
        ),
        'products_name' => '',
        'products_quantity' => '',
        'delivery_country' => '',
        'customers_name' => '',
        'delivery_name' => '',
        'delivery_street_address' => '',
        'delivery_city' => '',
        'delivery_postcode' => '',
        'delivery_state' => '',
        'customers_telephone' => '',
      ),
    ),
  ),

  2 => 
  array (
    197014 => 
    array (
      345414 => 
      array (
        'options' => 
        array (
          'Name on Credential' => '',
          'Ordination Month' => '',
          'Ordination Day' => '',
          'Ordination Year' => '',
          'Badge Choice?' => '',
        ),
        'comments' => 
        array (
          213353 => '',
        ),
        'products_name' => '',
        'products_quantity' => '',
        'delivery_country' => '',
        'customers_name' => '',
        'delivery_name' => '',
        'delivery_street_address' => '',
        'delivery_city' => '',
        'delivery_postcode' => '',
        'delivery_state' => '',
        'customers_telephone' => '',
      ),
    ),
  ),

  3 => 
  array (
    197013 => 
    array (
      345412 => 
      array (
        'options' => 
        array (
          'Name on Credential' => '',
          'Ordination Month' => '',
          'Ordination Day' => '',
          'Ordination Year' => '',
        ),
        'comments' => 
        array (
          213352 => '',
        ),
        'products_name' => 'Jedi',
        'products_quantity' => '1',
        'delivery_country' => '',
        'customers_name' => '',
        'delivery_name' => '',
        'delivery_street_address' => '',
        'delivery_city' => '',
        'delivery_postcode' => '',
        'delivery_state' => '',
        'customers_telephone' => '',
      ),
      345413 => 
      array (
        'options' => 
        array (
          '' => '',
        ),
        'comments' => 
        array (
          213352 => '',
        ),
        'products_name' => '',
        'products_quantity' => '',
        'delivery_country' => '',
        'customers_name' => '',
        'delivery_name' => '',
        'delivery_street_address' => '',
        'delivery_city' => '',
        'delivery_postcode' => '',
        'delivery_state' => '',
        'customers_telephone' => '',
      ),
    ),
  ),

Here’s a sample of the last code I tried using without success, if you replace unset($k); with return false; it will return which secondary array the needle appears in.

    // array_search with recursive searching, optional partial matches and optional search by key
    function array_find_r($needle, &$haystack, $partial_matches = false, $search_keys = false) {
        if(!is_array($haystack)) return false;
        foreach($haystack as $key=>&$value) {
            $what = ($search_keys) ? $key : $value;
            if($needle===$what) return $key;
            else if($partial_matches && @strpos($what, $needle)!==false) return $key;
            else if(is_array($value) && array_find_r($needle, $value, $partial_matches, $search_keys)!==false) return $key;
        }
        unset($k);
    }

$tty = array();
foreach($datas as &$k) {
    $tty[] = array_find_r('Jedi', &$k, true, false);
}

$tty=array_filter($tty); rsort($tty);


echo '<pre>'; var_export($datas); echo '</pre>';
  • 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-26T18:20:10+00:00Added an answer on May 26, 2026 at 6:20 pm

    Why not push the data you do need into a new array and unset the whole old array?

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have some data like this: 1 2 3 4 5 9 2 6
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build

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.