Need help with in_array

Hello,

i need help with in_array

i have:

$ids from Database, value $ids = [“545975”,“545976”,“545977”,“545978”,“545979”,“545980”,“545981”,“545983”,“545988”,“545997”,“546001”]

and i have second item $id = 4001

and how in_array this?

CODE:
https://hastebin.com/givazikato.php

Did you try reading the free manual?
https://www.php.net/in_array

If you are trying to match data stored in a database, do this in the query as part of a WHERE … clause. Something tells me that the $data variable is also from a query, so, you should probably be doing this all as a single JOINed query.

if (in_array($data[‘channelId’], $clan[‘channels_id’])) {

Since $clan is a row of data from the query, $clan[‘channels_id’] is an element of that row. It cannot be an array and the code has nothing for the in_array() to operate on.

If you show an example of your data, including where the $data variable comes from, and what result you expect from the query/code, someone can suggest a more direct method.

Sponsor our Newsletter | Privacy Policy | Terms of Service