Oihana PHP

extension.php

Table of Contents

Functions

extension()  : string
Generates the 'extension:extension_a,extension_b,...' rule expression.

Functions

extension()

Generates the 'extension:extension_a,extension_b,...' rule expression.

extension(string ...$values) : string

The field under this rule must end with an extension corresponding to one of those listed.

This is useful for validating a file type for a given path or url. The mimes rule should be used for validating uploads.

If you require strict mime checking you should implement a custom MimeTypeGuesser that can make use of a server side file checker that uses a mime library.

Parameters
$values : string

The allowed file extensions (e.g. jpg, png).

Return values
string

The compiled extension:<extensions> rule expression.

On this page

Search results