Skip to content

Tag: php

What is the best way to get /24 blocks from IP address ranges?

I am trying to figure out what the best/most efficient way to get individual /24 IP blocks from a range of IP addresses using PHP. I have ranges of IP addresses in an MySQL database (I cannot change how this is presented) and have to have individual ranges of /24 blocks saved, also in a specific way (I cannot…

If str_ireplace() doesn’t meet php condition

I have a code where I match comma-separated words to text using the str_ireplace() function: Please tell me how can I do the reverse logic? Those. if nothing is found or matched. else {} does not work. Full code: Answer The problem is that you’re adding the default categories whenever you don’t ma…

imap_setflag_full seems to do nothing?

I’m trying to flag a message as seen: The output is bool(true) but when I then re-fetch my messages (imap_fetch_overview) this is what I see: Clearly I’m doing something wrong, but I can’t spot what. Answer As written in the comments of imap_setflag_full, pop3 apparently does not support fla…

Laravel – simpliest elseif [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 7 months ago. Improve this question Hi, have i to do it more simple or its a normal practice? Answer Ins…

How insert Multiple Array item into One Array in PHP

i want to add multiple Array item into One Array Object in PHP i have array like below : And i need to Convert like below: Array Data maybe changed , but , i write this code for explain my problem : But this code returns the same as the first array! I want to return every item into one

Return S3 private file as stream

I’m currently working on a route for a project that I need to get a specific file from S3, read its content, and return as a binary. I can’t just use the S3 file url, because it is private and it is intentional (we just don’t want the bucket files open). But the problem is, I want to stream …