Jump to content

Removing something specific from an array?


CosmosRP

Recommended Posts

Hey guys.

 

How do you remove a specific element from an array?

 

Lets say I have a string like this:

 

$list = "guy,girl,boy,man,woman,lady";

 

Then I use explode to break it up into an array by commas:

 

$listArray = explode(",",$list);

 

Now $listArray contains everything. Now if I wanted to delete something specific from that array, how would I do that?

So for example, I want to delete "man" out of the array. How do I do that without know its key?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.