Delete from Multidimensional Array?
| From: | Mark D Hiatt | Date: | Tue, 03 Jun 2003 13:15:38 +0000 |
| Subject: | Delete from Multidimensional Array? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-149954@lists.php.net to get a copy of this message | ||
I think I've outsmarted myself, again. Can someone help me out of this,
please?
I've built a page that collects network card information, assigning each
element its place within a $Card array, and all of the cards to $NetCards.
As you enter your card information at the bottom, the previous card is
displayed above it, with a Delete checkbox option at the end of that row
($Delete[$Card]).
But I can't figure out how to actually delete that card from the "deck",
as it were. I've looked over the Arrays pages, but there's little there
about multi-dimensional arrays and I ended up more confused than ever.
Here's my print_r:
Array <=--- This is $NetCards
(
[0] => Array <=--- This one is just
$Card
(
[0] => 3Com <=--- Description
[1] => 12:34:45:78:90:AA <=--- MAC Address
[2] => 129.93.100.100 <=--- IP Address
)
[1] => Array
(
[0] => Intel 100b
[1] => 12:34:45:78:90:AB
[2] => 129.93.100.101
)
[2] => Array
(
[0] => ThinAire
[1] => 12:34:45:78:90:BB
[2] => 129.93.100.102
)
[3] => Array
(
[0] => 3Com
[1] => 12:34:45:78:90:BC
[2] => 129.93.100.103
)
)
How can I delete, say, the wireless card (ThinAire) which is third, here,
if someone clicks on that one's Delete box? Thanks!
Mark D Hiatt
"Better Documentation Through Science"