You have to study PHP's face functions, for example, instead of asking here, you can go to Google and type: "how to split the string" which is "how to split / cut a string", will come the function explode()
for example, from there you implement. Another thing: "how to get content from a txt file" that is "how to get content from a txt file" then 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 you want to autocomplete, you should use Ajax, so just study if you do not know. Sites to learn:
w3 is more practical and fast W3Schools Ajax
or MDN that is more "upgraded"
MDN Ajax
I did not answer your question directly, but I'm here to help, flw.