object array

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

Post Reply
puraskar
Forum Newbie
Posts: 9
Joined: Thu Oct 12, 2006 12:42 pm

object array

Post by puraskar »

Hi Everyone ...

Hope everyone enjoying heading towards summer.

I've an array created by simplexml_load_file method which obviously store data in array of objects.

I want to delete some values(items) in array if a condition satisfy. and store the array in another array as object itself.

so, is there a way to delete one or more element in array of objects according to the condition supplied.

any clue will be appreciated.

thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: object array

Post by Christopher »

You can use unset() or array functions like array_slice() to delete elements of an array. See the section in the manual about arrays.
(#10850)
Post Reply