current_url()

function current_url(): string

Description

Get the current URL of the web page.

Return Value

Type Description
string The current URL as a string.

Example Usage

PHP
echo current_url();
// Output: http://example.com/current_page