473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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
Jan 16 '08 #1
1 1448
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
Jan 17 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: franzkowiak | last post by:
Hello, I've read some bytes from a file and just now I can't interpret 4 bytes in this dates like a real value. An extract from my program def l32(c): return ord(c) + (ord(c)<<8) +...
4
by: Andy | last post by:
What do people think of this? 'prefixed string'.lchop('prefix') == 'ed string' 'string with suffix'.rchop('suffix') == 'string with ' 'prefix and suffix.chop('prefix', 'suffix') == ' and ' ...
7
by: brian_harris | last post by:
I have a string object that I need to convert into an unmanged char * to be used by several unmnaged 3rd party functions. I have tried to use: (Marshal::StringToHGlobalAuto (Profname)) This would...
1
by: zoltix | last post by:
Hi, I would like to interpret the JavaScript code in c#. I have some methods in JavaScript; is it possible to execute those methods which return a result programmatically. Example String...
1
by: Don | last post by:
Hi, I did a php script and tested with the browser by giving the full path of script as URL under a domain name (ex : http://www.AAA-tech.com/TEST/myScript.php), it works fine. Then I launched...
3
by: Jarod_24 | last post by:
My program (it's a webcrawler) downloads htmlpages and in some cases the html has <script> </script> tags in it that generates parts of the html. How can i interpret this javascript and get the...
7
by: Malcolm | last post by:
This is a program to convert a text file to a C string. It is offered as a service to the comp.lang.c community. Originally I thought it would be a five minute job to program. In fact there are...
4
by: Jean-François Michaud | last post by:
Hello, I've been looking at this for a bit now and I don't see what's wrong with the code. Can anybody see a problem with this? Here is an XSLT snippet I use. <xsl:template match="graphic">...
2
by: hup | last post by:
One of my Linux (CentOS) server stop interpret php code any more. I did try to compile and installed other version of php, but it's still not working. # cat /tmp/phpinfo.php <? phpinfo() ?>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.