1

How I can get access to variable scope in different php file? For example:

one.php:

<?php $var1 = true; ?>

two.php:

<?php if( $var1 == true ) ?>
1
  • 1
    If it's a variable that you use regularly it may be worth setting up a config file which you would then include in all your PHP files. Commented Dec 8, 2013 at 15:55

1 Answer 1

2
include("one.php");

Done. (see what I did there? ;))

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

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.