Oihana PHP

between.php

Table of Contents

Functions

between()  : string
Generates the 'between:min,max' rule expression.

Functions

between()

Generates the 'between:min,max' rule expression.

between(string|int|float $min, string|int|float $max) : string

The field under this rule must have a size between min and max params. Value size is calculated in the same way as min and max rule.

You can also validate the maximum size of uploaded files using this rule:

$validation = $validator->validate
([
   'photo' => $_FILES['photo']
],
[
    'photo' => 'required|between:1M,2M'
]);
Parameters
$min : string|int|float

The minimum size (length, numeric value, or file size such as 1M).

$max : string|int|float

The maximum size (length, numeric value, or file size such as 2M).

Return values
string

The compiled between:min,max rule expression.

On this page

Search results