You have to study the functions of PHP guy, for example, instead of asking here, you can go on Google and type: "how to split a string" which is "how to split/cut a string", will come the function explode()
for example, then you implement. Another thing: "how to get content from a txt file" which is "how to get content from a txt file" from there in the PHP documentation will appear file_get_contents()
.
Example:
<?php
$contents = file_get_contents("file.txt");
$rows = explode("\n", $contents);
$cols = [];
foreach ($rows as $row) {
$cols[] = explode(" ", $row);
}
Now you have an array +/- like this:
[
["1", "Marcelo", "Rafael"],
["2", "Ana", "Clara"],
["3", "Berta", "Jota"]
]
Now, since Voce wants to autocomplete, Voce should use Ajax, so only study if you don’t know. Sites to learn:
W3 is more practical and fast
W3schools Ajax
or MDN which is more "updated"
MDN Ajax
I didn’t answer your question directly, but I’m here to help, flw.