Hi.
I need open some text file and insert it to some array. Can someone help me with this ?
use php function: fopen() fget() file()...
$filename = "/usr/local/something.txt"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle);
its good, but i need use some input type=file to get path to file, when i use it like :
<form name='pridat' action='' method='post'> <input type='file' name='soubor_dat' /><br /> <br /> <input type='submit' value='Odeslat' /> </form>";
if (isset($_POST[soubor_dat])){ if (!($_POST[soubor_dat] == '') ){ $f=$_POST[soubor_dat];
$f is now just name of file, but not path ... and then i cant open it by fopen, can you say me someelse possibility to get path ?
Comments
.
use php function:
fopen()
fget()
file()...
its good, but i need use
its good, but i need use some input type=file to get path to file, when i use it like :
if (isset($_POST[soubor_dat])){
if (!($_POST[soubor_dat] == '') ){
$f=$_POST[soubor_dat];
$f is now just name of file, but not path ... and then i cant open it by fopen, can you say me someelse possibility to get path ?