JPA>  >Do you mean you want to include the file
JPA> html.html but not the "<html>...</head>" part?
JPA> Yes!!. In other words I just want show the part inside of <body> tag of the 
JPA> html.html

JPA> I know the answer is in a Regulars expression.. but.. i don't know much 
JPA> about it.

JPA> At 19:08 17-07-2002, you wrote:
>>JPA> Hi guys, me again.
>>JPA> (thanks kevin, but i'm afraid you didn't understand me).
>>JPA> After looking for untiringly in the archives I have I decide to ask 
>>JPA> This is my problem:
>>JPA> I want include the file html.html inside of my file index.php, but 
>>JPA> include it I want to remove <html>..</head> tags from my html.html file.
>>JPA> My pseudo code would be look like this:
>>JPA>  > index.php
>>JPA> <?php
>>JPA> include_once("common.php");
>>JPA> header("Welcome to my page");
>>JPA>          include_html_file("html.html");
>>JPA> footer()
>>JPA>  > common.php
>>JPA> function include_html_file($f)
>>JPA>   {
>>JPA>          (your kind contribution:-) )
>>JPA>   }
>>JPA> thanks!!
>>JPA> --jp
>>How do you mean remove? Do you mean you want to include the file
>>html.html but not the "<html>...</head>" part? And why?
>>Best regards,
>>  Asmodean                            mailto:[EMAIL PROTECTED]
>>PHP General Mailing List (
>>To unsubscribe, visit:

JPA> ________________________________________________________
JPA> Juan Pablo Aqueveque <[EMAIL PROTECTED]>
JPA> Ingeniero de Sistemas
JPA> Departamento de Redes y Comunicaciones
JPA> Universidad Católica de Temuco.
JPA> Tel:(5645) 205 630 Fax:(5645) 205 628

Seems like a... strange thing to do. Anyway. Since I do not know of
any other way (if there is, anyone, tell), this is what you will have
to do.

1. Open the file with fopen()
2. Perform a regular expression on the content
3. Print the parsed cntents

For example:

$fp = fopen('html.html', 'r');
$content = fread($fp, filesize(html.html));

preg_match("/<body>(.*?)<\/body>/s", $content, $matches);

The parsed contents are now in $matches[1].

I still don't understand why you want to do this, though. Seems like
there must be a better way.

Best regards,
 Asmodean                            mailto:[EMAIL PROTECTED]

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to