php date plus days
<?php
// PHP program to add days to $Date
// Declare a date
$date = "2019-05-10";
// Add days to date and display it
echo date('Y-m-d', strtotime($date. ' + 10 days'));
?>
php date plus days
<?php
// PHP program to add days to $Date
// Declare a date
$date = "2019-05-10";
// Add days to date and display it
echo date('Y-m-d', strtotime($date. ' + 10 days'));
?>
range in php
<?php
// range($start, $end [,$steps])
$numbers = range(0, 5);
print_r($numbers);
// Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 )
$numbers2 = range(0, 5, 2);
print_r($numbers2);
//Array ( [0] => 0 [1] => 2 [2] => 4 )
?>
php range
function range($start, $end, int|float $step = 1) array
-------------------------------------------------------
Create an array containing a range of elements.
Parameters:
mixed--$start--First value of the sequence.
mixed--$end--The sequence is ended upon reaching the end value.
float|int--$step--[optional]--If a step value is given, it will be used as the increment between elements in the sequence.
Step should be given as a positive number. If not specified, step will default to 1.
Returns: an array of elements from start to end, inclusive.
Example :
=========
foreach ( range( 0, 60, 11 ) as $numbers ) {
if ( $numbers > 0 ) {
echo $numbers;
echo PHP_EOL;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us