Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog (1) | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 79 | All time: 10,036 This week: 171![]() |
Version | License | PHP version | Categories | |||
loops 1.0 | MIT/X Consortium ... | 8.0 | PHP 5, Language |
You can install the package via composer:
composer require isaeken/loops
loop(5, function ($loop, $instance) {
return $loop->odd;
}); // [false, true, false, true, false]
loop(2 ,function ($loop, $instance) {
return [
'iteration' => $loop->iteration,
'index' => $loop->index,
'remaining' => $loop->remaining,
'count' => $loop->count,
'first' => $loop->first,
'last' => $loop->last,
'odd' => $loop->odd,
'even' => $loop->even,
];
});
// [
// [
// 'iteration' => 0,
// 'index' => 0,
// 'remaining' => 1,
// 'count' => 2,
// 'first' => true,
// 'last' => false,
// 'odd' => false,
// 'even' => true,
// ],
// [
// 'iteration' => 1,
// 'index' => 1,
// 'remaining' => 0,
// 'count' => 2,
// 'first' => false,
// 'last' => true,
// 'odd' => true,
// 'even' => false,
// ]
// ]
loop(3, function ($loop, $instance) {
if ($loop->index > 1) {
$instance->stop();
}
return $loop->index;
}); // [0, 1]
loop_random(function ($loop, $instance) {
return $loop->index;
}); // executed random times.
$min = 5;
$max = 10;
loop_random(function ($loop, $instance) {
return $loop->index;
}, $min, $max);
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
You can install the package via composer:
composer require isaeken/loops
loop(5, function ($loop, $instance) {
return $loop->odd;
}); // [false, true, false, true, false]
loop(2 ,function ($loop, $instance) {
return [
'iteration' => $loop->iteration,
'index' => $loop->index,
'remaining' => $loop->remaining,
'count' => $loop->count,
'first' => $loop->first,
'last' => $loop->last,
'odd' => $loop->odd,
'even' => $loop->even,
];
});
// [
// [
// 'iteration' => 0,
// 'index' => 0,
// 'remaining' => 1,
// 'count' => 2,
// 'first' => true,
// 'last' => false,
// 'odd' => false,
// 'even' => true,
// ],
// [
// 'iteration' => 1,
// 'index' => 1,
// 'remaining' => 0,
// 'count' => 2,
// 'first' => false,
// 'last' => true,
// 'odd' => true,
// 'even' => false,
// ]
// ]
loop(3, function ($loop, $instance) {
if ($loop->index > 1) {
$instance->stop();
}
return $loop->index;
}); // [0, 1]
loop_random(function ($loop, $instance) {
return $loop->index;
}); // executed random times.
$min = 5;
$max = 10;
loop_random(function ($loop, $instance) {
return $loop->index;
}, $min, $max);
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() |
Data | Auxiliary data | ||
![]() |
Aux. | Auxiliary script | ||
![]() |
Data | Auxiliary data | ||
![]() |
Data | Auxiliary data | ||
![]() |
Lic. | License text | ||
![]() |
Data | Auxiliary data | ||
![]() |
Doc. | Documentation |
![]() |
/ | .github |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
Data | Auxiliary data | ||
![]() |
Data | Auxiliary data | ||
![]() |
Data | Auxiliary data |
![]() |
/ | .github | / | workflows |
File | Role | Description |
---|---|---|
![]() |
Data | Auxiliary data |
![]() |
Data | Auxiliary data |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.