In the code, I have bold text where I have a question.
I am not sure how to parse the file into different fields (right below with bold: machine,plan,st udy,scantype, date)... and I have more different files in the same format of this below.
Others also have machine,plan, study, scan type, date as their information.
right side of colon (:) have to be parsed separately..
Machine: 225kV_30cmTT_Rm tRecon_30UG6003
Plan: TIM_BONE
Study: MCZ_35677_20100 118-142011
Scan Type: AxialCT
Date: 2010.01.18 14:00:39
But I have no idea how to do this, can anyone help me out with this?
I am not sure how to parse the file into different fields (right below with bold: machine,plan,st udy,scantype, date)... and I have more different files in the same format of this below.
Others also have machine,plan, study, scan type, date as their information.
right side of colon (:) have to be parsed separately..
Machine: 225kV_30cmTT_Rm tRecon_30UG6003
Plan: TIM_BONE
Study: MCZ_35677_20100 118-142011
Scan Type: AxialCT
Date: 2010.01.18 14:00:39
But I have no idea how to do this, can anyone help me out with this?
Code:
<?php
//Change location to be where you put the file
$file = fopen("C:\wamp\www\Other.txt", "r") or exit("Unable to
open file!");
//Output a line of the file until the end is reached
while(!feof($file)){
echo fgets($file). "<br />";
[B]
//This is where you will need to parse through the file looking for the colon
//And put the part after the colon into a variable as well as on the screen[/B]
}
fclose($file);
?>
Comment