Php

Asked • 05/14/19

PHP array delete by value (not key)?

I have a PHP array as follows: $messages = [312, 401, 1599, 3, ...]; I want to delete the element containing the value `$del_val` (for example, `$del_val=401`), but I don't know its key. This might help: **each value can only be there once**. I'm looking for the simplest function to perform this task please.

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.