❮ PHP Output Control Functions
Add variables to URLs in the output:
<?php
// Make the URL rewriter affect <a href> and <form> tags
ini_set('url_rewriter.tags','a=href,form=');
// Add a variable
output_add_rewrite_var('var', 'value');
echo '<a href="">This link (URL) will have a variable</a><br>';
ob_flush();
// Remove the variable
output_reset_rewrite_vars();
echo '<a href="">This link (URL) will not have a variable</a>';
?>
Try it Yourself »
The output_reset_rewrite_vars()
function removes all variables that were added by output_add_rewrite_var() from the output buffer. This will not remove the variable from content that has already been sent, but will prevent them from being added to content that gets sent after this function call.
output_reset_rewrite_vars();
Return Value: | TRUE on success, FALSE on failure |
---|---|
PHP Version: | 4.3+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!