virtual

int virtual(string URI) 

Performs an Apache subrequest to parse and include a file.

Returns:

TRUE if successful; FALSE on error

Description:

This function enables you to perform an Apache subrequest. It performs the same function that mod_include allows you to perform (<!--#include virtual...-->) , but you can access the feature from within PHP scripts. This is useful if you want to include the output of a CGI script within your PHP file, for example. You can’t use virtual() on PHP files; use include() instead.

Version:

Existing since version 3.0

Warning:

In versions prior to 3.0.13, it was possible to use virtual() on PHP files under some circumstances.

Example:

Include the output of a Perl CGI script
 $script = "/cgi-bin/script.pl"; ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.