interpret string as path

interpret string as path

am 16.01.2008 15:23:41 von jonsoons

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

Re: interpret string as path

am 17.01.2008 04:50:37 von nothingsoriginalontheinternet

On Jan 16, 9:23 am, jonsoons 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