Using PHP Variables Within Multiple Scripts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alex.saidani
Forum Newbie
Posts: 7
Joined: Mon Jan 25, 2010 2:15 pm

Using PHP Variables Within Multiple Scripts

Post by alex.saidani »

I have some variables declared in a search engine that i have written, the search results are declared as something and the echoed as $column. However i want to be able to use this declared variable within another script that will select a link to an image from a database according to the results outputted, yet i do not know how to include the variables within another script. Is there a way of doing this?
Any help would be appreciated, thanks in advance.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Using PHP Variables Within Multiple Scripts

Post by s.dot »

Hmmm, the variables will be available within any other included script.. like this:

Code: Select all

$a = 'something';
 
//$a can be used inside this script
include 'my_other_script.php';
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply