Jump to content

[SOLVED] How can I remove an element of an array, without knowing its index, just value?


physaux

Recommended Posts

Here is a theoretical array:

 

myarray[0] = "word";

myarray[1] = "bottle";

myarray[2] = "screen";

myarray[3] = "php";

myarray[4] = "wow!";

...

 

How could I remove the array element with the value, (for example), "php"?

I want to be left without that entry, and the index missing a number after doesn't bother me.

 

myarray[0] = "word";

myarray[1] = "bottle";

myarray[2] = "screen";

myarray[4] = "wow!";

...

 

Any suggestions? Thanks!

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.