K
K
Konstantin2017-11-03 14:36:48
Regular Expressions
Konstantin, 2017-11-03 14:36:48

How to output a specific line from a file to an html page with a search form?

There is an html page with a search form, a file with 1500 thousand lines.
How to make it so that when you enter in the search form, a specific found string is displayed, and not the entire list. Without using MySql, limited to html, php

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Saboteur, 2019-08-09
@saboteur_kiev

What you want is not solved by regular expressions in principle.
This requires intelligence.

D
Dimonchik, 2019-08-09
@dimonchik2013

yes, Tensorflow and Tamita Parser

S
Sergej, 2017-11-03
@drKonstantin

Why PHP?
Isn't js + json easier?
You send an ajax request to a file and get a response.
Here is the first thing that came up in the search - autocomplete js json
https://codepen.io/massimo-cassandro/pen/NqRmMe?q=...
Anyway, there are a lot of https://codepen.io/search/pens?q =autocomplete&limit...

Y
Yakov Vylegzhanin, 2017-11-03
@vylegzhanin

1. Line by line pass through the file - , 2. Check for occurrence of a substring in a line - . 3. If it is included, then output a string. If it is not included, we do not withdraw. explode("\r\n", $file)foreach()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question