1

I want to know if and how I can define a file to be included.

for e.g.

<?php
//define('_login',inlcude('file.php'));
define('_login',include('file.php')); // edited due to typo..
?>

or would I need to do it this way

<?php
define('_login','file.php');
include(_login);
?>

the reason I ask is My site allows plugins and I want other developers to overwrite a define to include their plugin instead of the core _login define.

2 Answers 2

1

This one should be Ok:

<?php
define('_login','file.php');
include(_login);
?>

Event can't imagine what will happen in first case. Maybe if you return something from file - that value will be used?

Sign up to request clarification or add additional context in comments.

Comments

0

you have to use it like this

<?php
// works
if ((include 'vars.php') == 'OK') {
    echo 'OK';
}
?>

http://php.net/manual/en/function.include.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.