You can call for this include inside a function and then Return inside
included file.

Not sure if it's suitable for you, inside functions there are quite a
few extra things to do like Globals etc.

Or, you could fopen(), read the needed lines, assign to a variable and
eval() it. Quite a silly way though.


Sincerely,

Maxim Maletsky
Founder, Chief Developer
[EMAIL PROTECTED]

PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com
 


> -----Original Message-----
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, April 13, 2002 5:16 PM
> To: Alberto Wagner; Php General Mailling List
> Subject: Re: [PHP] Including only I want
> 
> Best hope is to include some if statements into the included file, and
> establish what you want to get out of the file, eg:
> 
> <?
> $section = "a";
> include('file.php');
> ?>
> 
> 
> --file.php--
> <?
> 
> if($section == "a")
>     {
>     // do something
>     }
> ?>
> --
> 
> Or perhaps make the few lines you're after a function, then all you
have to
> do is include your functions library on every page it's needed, and
then
> call the function to "do" the selected lines/calculations, with a
simple
> 
> <?
> domyfunction();
> ?>
> 
> 
> Regards,
> 
> Justin French
> 
> 
> on 13/04/02 7:32 PM, Alberto Wagner ([EMAIL PROTECTED]) wrote:
> 
> > Is there any way to include only the lines that I want in an other
PHP file?
> >
> > something like Include();
> >
> > like lines number 5,6 and 7.
> >
> > only this ones and not the entire script?
> >
> >
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to