You are here: Match a filename from a text file « All PHP « IT news, forums, messages
Match a filename from a text file

Posted by Juby on 09/28/22 11:46

I have a text file with the names of aerospace variables from our
company software. Each variable has a corresponding graphic for use in
the help files. Each line of the text file looks like this:
<pre>
<code> OpACoeffofPowervsSpeed = 'OpACoeffofPowervsSpeed'; (leading
spaces are in the file)</code>
</pre>
And then there is the graphic OpACoeffofPowervsSpeed.wmf. The problem
is, I can't seem to get the script to see the graphic file. I've tried
using both explode() and preg_match() to pull the variable name from
the line, trim()'ed it just to be sure, tagged on the string ".wmf" at
the end, then ran
<pre>
<code>file_exists($path . $filename);</code>
</pre>
which returns false. What really has me befuddled, though, is that if
I put in the line
<pre>
<code>file_exists($path . "OpACoeffofPowervsSpeed.wmf");</code>
</pre>
it returns true. I can't figure out, for the life of me, why it is
doing this. If anyone can help, I would be very much appreciative. If
you need to see the rest of the script, or the originating text file, I
can get those to you, but there's not really a whole lot else to see.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация