Jump to content

[SOLVED] Add $ to text data during file read


jnerotrix

Recommended Posts

is there a way so when you

 

Use PHP to Read A Text File

 

$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo $theData;

 

You Can add a $ to the Front of Every Line Read

 

Like If the data in the file was

 

name = "john"

address = "that road"

ip = "1.0.0.127"

 

And Every time it reads a line it adds $ to the begining

 

so it would read like this

 

$name = "john"

$address = "that road"

$ip = "1.0.0.127"

 

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.