0
I’m having a hard time trying to generate the Json using the basis of a txt by certain positions. I could not evolve the code because I do not know how to make a explode in the position I need. Ex:
I have the file test.txt containing the following data:
1001444Denis
1233243Joao
4341233Maria
of position (1) to (4) I have the login
of position (5) to (7) I have the password
of position (8) to (100) I have the name of the person
each line closes exactly at position 100
I did the code below but could not evolve:
<?php
$file = fopen('teste.txt', 'r');
while(!feof($file)){
$content = fgets ($file);
?>
When I give a var_dump
it returns me the complete information of each line.
Jonathan, thank you so much for your help. your method also worked.
– Robson Freitas