Jump to content

Simple PHP include question


forcer

Recommended Posts

I have some variables in a seperate PHP file that i want to call/echo into my main php file..

 

example..

 

in vars.php i want to call $variable = "whatever...";

 

into

 

index.php

 

i would use <?php echo $variable; ?>

 

but with it being in a seperate file...

 

would i just use <?php include("vars.php"); ?> at the top of index.php

 

sorry about the noob question, i'm also not in my testing environment at the minute.. so i havent been able to test it. thanks

Link to comment
https://forums.phpfreaks.com/topic/112165-simple-php-include-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.