Jump to content

Grab file from computer?


TFD3

Recommended Posts

Can a PHP script grab a text file from my computer and parse it like it is a URL?

 

Example:

 

<?php
$url= "file:///C:/Program%20Files/grlx_eta/cone.txt";
if($content=file_get_contents($url)){
$lines= explode("\n",$content); //Breaks at each new line;
$lindex[0] = $lines[113];
$lindex[1] = $lines[114];
$lindex[2] = $lines[115];
}//close of if statement
//print_r($lines);
foreach($lindex as $value){
echo $value."<br/>";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/103092-grab-file-from-computer/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.