473,322 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

filtering key-value pairs in a multidimensional array

I have a multidimensional array with a few entries I need to delete.
Key and values are not unique in different sub arrays.

As far as I know the filter function is not recursive and only deletes
values, not keys.

How can I do that?

thanks
Luca

Oct 1 '07 #1
2 2903
Snaggy wrote:
I have a multidimensional array with a few entries I need to delete.
Key and values are not unique in different sub arrays.

As far as I know the filter function is not recursive and only deletes
values, not keys.

How can I do that?

thanks
Luca
Hi,

Then don't use filter, but use unset() on the elements you want to delete.

$arr = array(
"one" =array(1,"yes","no"),
"two" =23,
"something" =array(array(1,2,3),55)
);

if you want to delete the 55:
unset ($arr["something"][1]);

if you want to delete the whole "something":
unset ($arr["something"]);

etc.

But without more information, this might be irrelevant. ;-)
Regards,
Erwin Moller
Oct 1 '07 #2
I can't believe I missed that, thank you very much!

Luca
Oct 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark V. | last post by:
Here's what I have and I'm stumped. I have a table that has several thousand names and addresses. I only want to send to one address in a household. So what I would like to do is create a new...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
19
by: Chantelle | last post by:
I've got this A2K DB that has a continuous form that lists Suppliers and their details. The form has a field for each supplier that holds several Keywords that reflect the suppliers products or...
2
by: JUAN ERNESTO FLORES BELTRAN | last post by:
Hi you all, I am developping a python application which connects to a database (postresql) and displays the query results on a treeview. In adittion to displaying the info i do need to implement...
1
by: hackerslacker | last post by:
I have an ordering form that use two combo boxes to filter down the records of a Products table. This worked fine with the after_Update of the first filtering the records and creating the...
2
by: Katie | last post by:
I need to store a history of two fields in two seperate tables: Event - where the key is Event_ID Stage - where the key is Stage_ID The joins are: Main Table Event Table Stage Table ...
7
by: Ryan | last post by:
I have a DataGridView which displays numeric (Int32) data from an underlying database. I want the numbers to be displayed in numeric format "#,###" (with commas). I want to also limit the user so...
0
by: sjoshi | last post by:
Hello All I'm trying to use a filter with collectiong derived off BindingList and I see that if I use the foreach way of adding and checking the item then I get instant feedback on the grid. If...
7
by: ovmysql | last post by:
Hi All, I cant product filtering. Please help. CREATE TABLE filter ( product_no int(11) unsigned NOT NULL, category_no int(11) unsigned NOT NULL, PRIMARY KEY (product_no,category_no)...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.