Skip to content

ACF & WordPress Media Library

I’ve got an ACF ‘options page’ with a placeholder image within, to fall back to if a client removes the image from the post/page by mistake. And I’m using the following code to handle this situation happening. This works fine once pages or posts are saved. However The issue I have is i…

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. …

How to improve eloquent nested foreach performance

How can I improve the performance of a query with the following characteristics (this is a simulation to exemplify): In my real case, the foreach returns a lot of data with performance problems; The Waiting (TTFB), that is, the time the browser is waiting for the first byte of a response, takes almost 27s Ans…

Binary image from API, convert and save path

Im receiving a binary image from an API (Line API) After receiving it, I want to save the image in my public folder and save the path in my database. There were several answers on SO that I thought could work like using intervention/image but I could not manage to fix this. Ive also found a comment saying thi…

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…