Skip to content

Tag: arrays

find repeating unknown value from different keys of subarrays in PHP

I have an Array like this. this is a connection log of some devices to Internet. source IP: [src_ip] and destination IP: [dst_ip] based on Sending or Receiving connection states change their position. we don’t know current network state (sending/receiving) also we don’t know current IP of device. …

php how to put foreach loop value in array

i want to put foreach in values in array to assign value as loop in array. how to do that? i try put foreach inside array but looks like its wrong. my array code: if i print i will get this value Array ( [0] => Array ( [item_varid] => 109 [item_id] => 146 [item_basename] => aaa [item_baselink] =&g…

Search data from array of object inside foreach loop

I have 3 array. The first one is array employee, second is array dateRange(Y-m-d), and the third is array attendance The array is like this: Array Employee Array dateRange Array Attendance (both in & out) What I want to do is to get attendance data from array attendance where employee_id is the same as em…

Dont print empty json arrays in php

Im programming a website where I can query server details from a game server. The problem is, that Ark sometimes prints empty playernames. That happens because there connecting at this moment or because they’re bots. I dont want to show them on my website. The problem is, that i don’t know how to …