Skip to content
Advertisement

Tag: range

PHP Generate day range

I am trying to generate the range of days, from 1 to 28, with the English ordinal suffix for the day of the month. For example: 1st of month, 2nd of month… for($i = 1; $i <= 28; $i++) { $...

How to get total time from several date ranges in php

I have several date ranges in form of DateTime $begin, DateTime $end. Those ranges can overlap in every possible way: etc. What I am trying to do is to get length (in seconds or DateInterval) of those ranges between start of the first one and the end of the latest one (fourth in the case above), excluding regions not covered

Restriction based on IP ranges

I am building an admin panel. and I want to block certain IP ranges. I’m testing this on my localhost wamp server but ir doesn’t seem to redirect me. Any input is appreciated. Answer Is sufficient to use string comparison Update: Taken from the comments of inits answer Suppose i want to block any IP coming from this range: 192.168.0.1-255.

Advertisement