Skip to content
Advertisement

How to remove specific element from array in php

I have the following array

JavaScript

I want to remove 60b6a8a38cf91900695dd46b from the multiple_assignee array. I have tried with the following code:

JavaScript

But it is not removing that element. The intention is I don’t want to repeat the 60b6a8a38cf91900695dd46b assignee in the multiple assignee array.

I have also tried with the following code:

JavaScript

But it is resulting as

JavaScript

rather than

JavaScript

Thank you

Advertisement

Answer

Just extract the accountId column and search that. Then use that key:

JavaScript

After your edit it seems you just want to reindex the subarray after unset:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement