Re: Including only I want

From: Date: Sat, 13 Apr 2002 15:16:24 +0000
Subject: Re: Including only I want
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-92879@lists.php.net to get a copy of this message
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 (albertonews@terra.com.br) 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? > > >

« previous php.general (#92879) next »