I need to read and parse the txt
file on the network with PHP.
"Warning: file_get_contents(file//10.0.2.129/lims/lims.txt): failed to open stream: No such file or directory in C:\AppServ\www\mail\index.php on line 2"
This way I get the error message.
<?php
$txt_file = file_get_contents('file//10.0.2.129/lims/lims.txt');
function sp($x) {
return preg_split("/\s\s+|\s*\((\d{4}).*\)/", $x,0,PREG_SPLIT_DELIM_CAPTURE);
}
$array = preg_split("/\n/", $txt_file);
$processed = array_map('sp', $array);
print_r(json_encode($processed));
?>
try using file_get_contents('./lims/lims.txt'); but make sure to choose the right path depending the location you are calling this function from.