|
Posted by Alvaro G. Vicario on 12/17/93 11:54
*** walterbyrd escribió/wrote (2 Aug 2006 10:49:28 -0700):
> I know I can use the file() function to read a file into an array by
> providing a literal file name between single quotes:
>
> $lines = file('literal_file_name');
>
> But, what if I want file() to use a variable name?
From manual:
array file ( string filename [, int use_include_path [, resource context]]
)
You need to provide a string. Period. PHP doesn't know/care how you create
the string.
> $variable_file_name = "literal_file_name";
> $lines = file($variable_file_name);
>
> Of course, that example won't work. But what will?
What error are you getting?
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Navigation:
[Reply to this message]
|