NYCPHP Meetup

NYPHP.org

[nycphp-talk] delete one element from array

y2rob at aol.com y2rob at aol.com
Thu Jun 4 12:39:38 EDT 2009


 yeah i think unset would work just fine.

~rob


 


 

-----Original Message-----
From: Eddie Drapkin <oorza2k5 at gmail.com>
To: NYPHP Talk <talk at lists.nyphp.org>
Sent: Wed, 3 Jun 2009 9:26 pm
Subject: Re: [nycphp-talk] delete one element from array









Nope, because that'll unset the eighth element!

You want unset($array[6]) :P

And then if you want to re-key the array: array_slice($array)


On Wed, Jun 3, 2009 at 9:17 PM, Darryle Steplight <dsteplight at gmail.com> wrote:


unset($array['7']) doesn't work?







On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell

<michael.southwell at nyphp.com> wrote:

> This has to be easy but I'm so pre-occupied with other stuff that I can't

> get it.

>

> I have an array, let's say 12 elements. I want to remove element 7. I could

> array_slice out the first 6 and also the last 5 and then combine those

> resulting arrays but that seems like a very tedious way to do it. There has

> to be an easier way????????

> --

> =================

> Michael Southwell

> Vice President, Education

> NYPHP TRAINING: ?http://nyphp.com/Training/Indepth

> _______________________________________________

> New York PHP User Group Community Talk Mailing List

> http://lists.nyphp.org/mailman/listinfo/talk

>

> http://www.nyphp.org/show_participation.php

>









--

A: It reverses the normal flow of conversation.

Q: What's wrong with top-posting?

A: Top-posting.

Q: What's the biggest scourge on plain text email discussions?





_______________________________________________

New York PHP User Group Community Talk Mailing List

http://lists.nyphp.org/mailman/listinfo/talk



http://www.nyphp.org/show_participation.php









 





_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php



 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090604/97ebabce/attachment.html>


More information about the talk mailing list