11-19-2008, 02:05 AM
|
#6 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
In keeping with your style, however, I have created this for you, with a little debug functionality as well, just in case you require it.
php Code:
class Customisation { private static $m_aData; const THROW_EXCEPTIONS = false; public static function getLine ($iLine) { if (empty(self:: $m_aData)) { self:: $m_aData = file('setting.txt'); } if (! isset(self:: $m_aData[ $iLine - 1] )) { if (self:: THROW_EXCEPTIONS) { throw new Exception (sprintf('Line %d does not exist', $iLine)); } return null; } return self:: $m_aData[ $iLine - 1]; }}echo Customisation:: getLine(3);
Then you can use it as so:
php Code:
if (Customisation:: getLine(5) == 'colored'){ echo 'Do this'; }else{ echo 'Do something else'; }
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|