Hi all
I’m using this code to write to a text file:
[code=php]if (file_exists($file)) {
$fp = fopen($file, “w”) or die(
require(“fileerror.php”)
); }
$numBytes = fwrite($fp, $values) or die(
require(“fileerror.php”)
);
fclose($fp);
please tell me if this could be improved.
what I need to do is randomly insert a character when writing to a text file.
So it looks all jumbled up when loaded at.
e.g.
this is the text file now:
[CODE]
Email Notification: emails sent to you whenever someone replies. Only registered users are eligible.
and this is how I’d like it:
[CODE]
Em%a%il No%%%ti%fi%%c%ati%%%on: e%a%i%ls s%en%t to% y%ou whe%%ne%ver %%som%eo%ne rep%%li%es%%%. On%ly %reg%%is%te%red%%% us%e%rs are e%%%lig%i%ble%.
it doesn’t have to be the % character, it can be anything that will not mess with the php code that generates it.
Can this be done?
Cheers
Chris