store data into a text file using php?

前端 未结 6 1345
有刺的猬
有刺的猬 2021-01-13 14:46

i am trying to store data in a text file, something like an array into a text file using php instead of storing into mysql database.

for example here are the data to

6条回答
  •  渐次进展
    2021-01-13 15:25

    You may use

    • fopen and fwrite to write your data into a file. See also http://www.tizag.com/phpT/filewrite.php
    • the file_get_contents function to read from files. See more: http://php.net/manual/en/function.file-get-contents.php

    In case you want to convert the array to an XML you might want to read this post: How to convert array to SimpleXML

提交回复
热议问题