To::entity()

Converts characters to their corresponding HTML entities.

Table of Contents
  1. Description
  2. Example

Description

To::entity(?string $value, $hex = false, int $pad = 4): ?string;

This method converts characters to their corresponding HTML entities.

Example

$value = To::entity('I ❤ U'); // Returns `'I ❤ U'`
$value = To::entity('I ❤ U', true); // Returns `'I ❤ U'`
$value = To::entity('I ❤ U', false, 0); // Returns `'I ❤ U'`
$value = To::entity('I ❤ U', true, 0); // Returns `'I ❤ U'`

To::URL()

Converts private file path to public URL, or decodes URL special characters.

To::entity()

Converts characters to their corresponding HTML entities.

To::file()

Converts current value to a safe file name.

To::path()

Converts public URL to private file path.