Skip to content
Advertisement

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. IP of device is fixed but sometimes it placed on [src_ip] sometimes

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] => products.php?id=146

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 employee_id in array employee. What I’ve

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 exclude them. Maybe somebody can help me.

Array to tree structure with no Id just string as keys (is this possible?)

I’ve been failing (my whole day) in getting this structure formatted as a tree to present in this format, see picture attached. as this has not parent and child the names of the key values strings like pattern_type_name act like parents and pattern_name are the child and under pattern_name are the marker_description to present the structure. structure to display any

Invalid JSON path expression. The error is around character position

I insert json data to mySql database like this: Now, I try to update social-enable value using JSON_REPLACED method like this: In action I see this error: How do can I fix this problem? Answer JSON Path Syntax … Names of keys must be double-quoted strings or valid ECMAScript identifiers (see Identifier Names and Identifiers, in the ECMAScript Language Specification).

Advertisement