PHP | output_add_rewrite_var() Function Last Updated : 28 Apr, 2023 Comments Improve Suggest changes Like Article Like Report The output_add_rewrite_var() function is an inbuilt function in PHP that is used as an output control functions to add values of URL rewriter. This function adds another name or value pair to the URL rewrite mechanism. The name and value will be added to URLs (as GET parameters) and forms (as hidden input fields) in the same way as transparent URL rewriting is enabled with the session.use_trans_sid instead of the session ID. The behavior of this function is controlled by url_rewriter.tags and url_rewriter.hosts php.ini parameters. In the further version dedicated output buffer is used, url_rewriter.tags is used solely for output functions, and url_rewriter.hosts are added. Note: Calling the output_add_rewrite_var() function start output buffering implicitly even if it is not active already. Syntax: bool output_add_rewrite_var( string $name, string $value ) Parameters: $name: It holds the variable name in string format.$value: It holds the value of the variable in string format. Return Value: This function returns TRUE on success and FALSE on failure. The below programs illustrate the output_add_rewrite_var() function in PHP. Program 1: php <?php session_start(); output_add_rewrite_var('var', 'value'); echo '<a href="file.php">link</a>'; echo '<form action="script.php" method="post"> <input type="text" name="var2" /> </form>'; print_r(ob_list_handlers()); ob_flush(); output_reset_rewrite_vars(); echo '<a href="file.php">link</a>'; print_r(ob_list_handlers()); ?> Output: Program 2: php <?php output_add_rewrite_var('var', 'value'); // HTML link of web page echo '<a href="index.php">Home Page Link</a> <a href="https://www.geeksforgeeks.org"> GeeksforGeeks </a>'; // HTML form element echo '<form action="index.php" method="post"> <input type="text" name="yourname" /> </form>'; print_r(ob_list_handlers()); ?> Output: Reference: https://www.php.net/manual/en/function.output-add-rewrite-var.php Comment More infoAdvertise with us Next Article PHP | output_add_rewrite_var() Function V VigneshKannan3 Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP output_reset_rewrite_vars() Function The output_reset_rewrite_vars() is a built-in function in PHP, resets URL rewriter values by removing all rewrite variables previously set through the output_add_rewrite_var() function. Syntax: output_reset_rewrite_vars(): boolParameter: This function does not accept any parameters. Return Values: T 1 min read PHP | get_defined_vars() Function The get_defined_vars() function is an inbuilt function in PHP which is used to returns an array of all defined variables. This function returns a multidimensional array which contains all the list of variables, environment etc. Syntax: array get_defined_vars( void ) Parameters: This function does no 1 min read PHP | print_r() Function The print_r() function is a built-in function in PHP and is used to print or display information stored in a variable. Syntax: print_r( $variable, $isStore ) Parameters: This function accepts two parameters as shown in above syntax and described below. $variable: This parameter specifies the variabl 2 min read PHP var_dump() Function The var_dump() function in PHP is used to display structured information about one or more variables. The structured information means type and value of the given variable. It outputs not just the value of the variable but also its data type and, in the case of arrays or objects, all of their struct 2 min read PHP | ob_start() Function Let's take a quick recap. PHP is an interpreted language thus each statement is executed one after another, therefore PHP tends to send HTML to browsers in chunks thus reducing performance. Using output buffering the generated HTML gets stored in a buffer or a string variable and is sent to the buff 2 min read PHP | rewind( ) Function The rewind() function in PHP is an inbuilt function which is used to set the position of the file pointer to the beginning of the file. Any data written to a file will always be appended if the file is opened in append ("a" or "a+") mode regardless of the file pointer position. The file on which the 2 min read PHP | http_build_query() Function The http_build_query() function is an inbuilt function in PHP which is used to generate URL-encoded query string from the associative (or indexed) array. Syntax: string http_build_query( $query_data, $numeric_prefix, $arg_separator, $enc_type = PHP_QUERY_RFC1738 ) Parameters: This function accepts f 2 min read PHP realpath_cache_get() Function The realpath_cache_get() function is an inbuilt function in PHP that retrieves the current contents of the realpath cache. The realpath cache is used by PHP to store the results of mapping file paths to their real or canonical paths on the filesystem. Syntax: realpath_cache_get(): arrayParameters: T 2 min read PHP | var_export() Function The var_export() is a built-in function in PHP which is used to return the structured value(information) of a variable that is passed to this function as a parameter. This function is similar to the var_dump() function.Syntax: var_export($var, $return) Parameters: This function accepts two parameter 1 min read PHP set_include_path() Function The set_include_path() function is an inbuilt function in PHP that sets the include_path configuration option. Syntax: string|false set_include_path(string $include_path)Parameters: This function accepts one parameter that is described below: $include_path: This parameter specifies the new value for 1 min read Like