note 52342 modified in function.include by danbrown

From: Date: Mon, 18 May 2009 01:05:12 +0000
Subject: note 52342 modified in function.include by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155481@lists.php.net to get a copy of this message
Something not previously stated here - but found elsewhere - is that if a file is included using a URL and it has a '.php' extension - the file is parsed by php - not just included as it would be if it were linked to locally. This means the functions and (more importantly) classes included will NOT work. for example: <?php include "http://example.com/MyInclude.php"; ?> would not give you access to any classes or functions within the MyInclude.php file. to get access to the functions or classes you need to include the file with a different extension - such as '.inc' This way the php interpreter will not 'get in the way' and the text will be included normally. --was-- Something not previously stated here - but found elsewhere - is that if a file is included using a URL and it has a '.php' extension - the file is parsed by php - not just included as it would be if it were linked to locally. This means the functions and (more importantly) classes included will NOT work. for example: include "http://MyServer.com/MyInclude.php"; would not give you access to any classes or functions within the MyInclude.php file. to get access to the functions or classes you need to include the file with a different extension - such as '.inc' This way the php interpreter will not 'get in the way' and the text will be included normally. http://php.net/manual/en/function.include.php

« previous php.notes (#155481) next »