Hello,
My data.txt file is formated like this:
qqqq||eeee
rrrr||tttt
yyyy||uuuu
iiii||oooo
aaaa||bbbb
I'm trying to get this code to replace the data I put in $name but it
is not changing.
How can the php code be changed to modify the data I put in $name?
<?php
$name = "aaaa"
if(is_writable( "data.txt") )
{
$fp = fopen("data.txt ","a");
$content = $fp;
$rplName = str_replace("aa aa","TestRpl",$ content);
fwrite($fp, $rplName);
fclose($fp);
}
else
{
echo'File is not writable';
}
?>
Thank you for your help,
jfcby
My data.txt file is formated like this:
qqqq||eeee
rrrr||tttt
yyyy||uuuu
iiii||oooo
aaaa||bbbb
I'm trying to get this code to replace the data I put in $name but it
is not changing.
How can the php code be changed to modify the data I put in $name?
<?php
$name = "aaaa"
if(is_writable( "data.txt") )
{
$fp = fopen("data.txt ","a");
$content = $fp;
$rplName = str_replace("aa aa","TestRpl",$ content);
fwrite($fp, $rplName);
fclose($fp);
}
else
{
echo'File is not writable';
}
?>
Thank you for your help,
jfcby
Comment