|
Posted by comp.lang.php on 01/10/07 07:16
Consider my code:
[PHP]
/**
* Set the TTF array property $ttfArray
*
* @access private
* @see actual_path
*/
function &setTTFArray() { // STATIC VOID METHOD
global $ttfPath; // OBTAIN VAR FROM project_globals.inc.php
if (is_dir($ttfPath)) {
$dirID = @opendir(actual_path($ttfPath));
while ($ttf = @readdir($dirID)) if
(@is_file(actual_path("$ttfPath/$ttf")) && preg_match('/\.ttf$/i',
$ttf)) @array_push($this->ttfArray, actual_path("$ttfPath/$ttf"));
}
}
[/PHP]
This will generate an array of TTF font names, however, the problem is
that it generates an array of TTF font FILE names, which is usually
utterly unreadable, at least unknowable, to the user.
How can I change it to be an array of the actual TTF font names and not
the literal TTF font FILE names?
The directory will be utterly dynamic as this is from a portable web
application.
Thanx
Phil
Navigation:
[Reply to this message]
|