Answer the question
In order to leave comments, you need to log in
How to make a php method - display text from a txt file?
I really need help. Himself - confused. I know there is such an opportunity, but I forgot how to implement it.
The question is the following:
I have a TXT file, it contains lines with information.
by type: photo URL, photo URL, Country, City, Region
,
Price I don't understand how this can be implemented..
Can this be done without MySQL?
And if only through MySQL - then how can this be done? Perhaps someone knows at least a lesson on the Internet on this topic, an article, whatever :)
Answer the question
In order to leave comments, you need to log in
1. Read the php file line by line, parse the line into a separate url, city, and so on.
Check your filter - if it matches - output the line.
2. Read the php file line by line, parse the line into a separate url, city, and so on.
Add everything to the array.
Then you work with the array - check the filters, output what you need
3. spend 1 hour learning the select command, spend 1 hour learning the insert command, spend 2 hours learning how to work with sqlite from php with viewing examples
Translate your text file into sqlite format, and go
Can this be done without MySQL?If you have a small amount of data, <200-500Mb in total and don't need some of the features of a "thick" database like MySQL - you can use SQlite3 , its support is built into PHP since version 5.3+ (I think).
SELECT * FROM table1 WHERE city = 'Москва';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question