output_reset_rewrite_vars()

output_reset_rewrite_vars() — Reset URL rewriter values.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

This function removes all rewrite variables previously set by the output_add_rewrite_var() function.

Signature

output_reset_rewrite_vars(): bool

Parameters

This function takes no parameters.

Return value

Returns true on success or false on failure.

Example

A runnable snippet:

ini_set('url_rewriter.tags', 'a=href'); output_add_rewrite_var('var', 'value'); echo '<a href="file.php">link</a>'; ob_flush(); output_reset_rewrite_vars(); echo '<a href="file.php">link</a>';

Output:

<a href="file.php?var=value">link</a> <a href="file.php">link</a>

Changelog

VersionChange
7.1.0Before PHP 7.1.0, rewrite vars set by output_add_rewrite_var() use the same Session module trans sid output buffer. Since PHP 7.1.0, dedicated output buffer is used and output_reset_rewrite_vars() only removes rewrite vars defined by output_add_rewrite_var().

See also

output_add_rewrite_var(), ob_flush(), ob_list_handlers()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page output_reset_rewrite_vars() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.