views:

245

answers:

2

i want to have ONE file from which PHP can source content text such as title, marquee and other small updates. i think i remember something like this in asp where you can point asp to a line on a text file and it will pluck it out.

help!!

thanks.

dan

+2  A: 

In your PHP file, create a class:

class Foo {

    public static function getMarquee() { 
        return 'marquee';
    }

    ...

}

Then you can just call whichever method you want from any file:

require_once 'foo.php';

echo Foo::getMarquee();
Zack
A: 

The file() function reads in a file and explodes it by line breaks into an array (which it returns). Perhaps you could put each "entry" on a separate line and then simply grab it by doing something like $filedata[$line].

mattbasta