Jump to content

help with flat file commends


Renlok

Recommended Posts

what would be the code to add something into a flat file which will appear 1 line before the end but after the previous entry?
if so whats the code to do this?


what is mean by appearing one line before the end if you didnt understand:

entry 1
new entry
end tag

thanks for any help.
Link to comment
https://forums.phpfreaks.com/topic/28854-help-with-flat-file-commends/
Share on other sites

thanks ill try that out.
i tryed
[code]
  $fp = fopen("http://www.we-link.co.uk/sitemap.xml","a");

  if(!$fp) {
    echo 'Error: Cannot open file.';
    exit;
  }
  $arr = file("http://www.we-link.co.uk/sitemap.xml");
  fwrite($fp, "<url>
<loc>".$url."</loc>
<priority>0.5</priority>
<changefreq>Weekly</changefreq>
</url>", ( count($arr)-2 ));

  fclose($fp);
[/code]
no luck any errors?

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.