PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Dec 05, 2006 1:40 am
i want to remove element form array and what i know is '14937777' or '14547812', that's all, can i remove array form main array?
Code: Select all
Array
(
[14547812] => Array
(
[0] =>
[1] => Orch
[2] => Z
[3] => 245
)
[14937777] => Array
(
[0] =>
[1] => 140
[2] => I
[3] => 685
)
)
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Dec 05, 2006 2:05 am
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Dec 05, 2006 2:27 am
it simply unseats whole array:
you can see there are two array in one array, i want to remove one of them not the whole array.
dibyendrah
Forum Contributor
Posts: 491 Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:
Post
by dibyendrah » Tue Dec 05, 2006 4:48 am
Code: Select all
<?php
$var = array(0=>array('x', 'y', 'z'), 1=>array('a', 'b', 'c'));
print_r($var);
unset($var[0][0]);
print_r($var);
?>
Output :
Code: Select all
Array
(
[0] => Array
(
[0] => x
[1] => y
[2] => z
)
[1] => Array
(
[0] => a
[1] => b
[2] => c
)
)
Array
(
[0] => Array
(
[1] => y
[2] => z
)
[1] => Array
(
[0] => a
[1] => b
[2] => c
)
)
Hope you have an idea now.
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Dec 05, 2006 5:35 am
thanks dibyendrah.