interpret string as path

I have a file of paths to fonts like this:
/var/lib/defoma/fontconfig.d/U/URWBookmanL-LighItal.pfb
I read these into an array then I want php to open each font as a
resource.
php does not see the string as a path. What can I do to convert these
to paths?

Thanks
jonsoons [ Mi, 16 Januar 2008 15:23 ] [ ID #1909714 ]

Re: interpret string as path

On Jan 16, 9:23 am, jonsoons <jonso... [at] gmail.com> wrote:
> I have a file of paths to fonts like this:
> /var/lib/defoma/fontconfig.d/U/URWBookmanL-LighItal.pfb
> I read these into an array then I want php to open each font as a
> resource.
> php does not see the string as a path. What can I do to convert these
> to paths?
>
> Thanks

Do you mean a file resource like this?

##################
$fontpaths = array();
//...populate $fontpaths
$fonts = array();
foreach( $fontpaths as $fontpath )
$fonts[$fontpath] = fopen( $fontpath, 'r' );
##################

PHP does not "see the string as a path." The function or construct you
pass it to just uses it as a path, but until then its just another
string.

What are you trying, and what happened that you know it didn't work?

-Michael Placentra II | ZCE
nothingsoriginalonthe [ Do, 17 Januar 2008 04:50 ] [ ID #1910702 ]
PHP » comp.lang.php » interpret string as path

Vorheriges Thema: sending mail to Kerio MS
Nächstes Thema: Flash - Problem to call an mp3 file from a swf file