I do not have access to a database. Is there a way to store a php or javascript in a permanent txt file or xml file?
Any help would be appreciated
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Direct answer to the question
To answer your question directly (storing one variable) you would do:
To retrieve the value you would do something like this:
By using
serialize()you allow your code to store an array or stdClass object as well as numbers and strings in$my_var.SQLite would be better
If the server supports SQLite then I would recommend using it if you need to store more than one variable.
To interact with SQLite I would recommend using PHPs PDO or perhaps Idiorm.