To · Mecha CMS

Convert from X to Y.

$to::{url,u_r_l}()

Author: Taufik Nurrohman · 26 Views

Tweet

Convert private file path into public URL, or decode URL special characters.

To::url($in, $raw = false);
To::u_r_l($in, $raw = false);

Example:

$test_1 = To::url('.\path\to\file.html');
$test_2 = To::url('foo%20bar+baz');
$test_3 = To::url('foo%20bar+baz', true);