interpret string as path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jonsoons

    #1

    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
  • Mike Placentra II

    #2
    Re: interpret string as path

    On Jan 16, 9:23 am, jonsoons <jonso...@gmail .comwrote:
    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

    Comment

    Working...