I am currently working on php page creating, and there is one requirement that I need to work on but I am stuck.
There is accounts.txt which has n rows of : date,time,id,status and 4 columns (date,time,id,status).
And basically, I need to split them by "\n" and then "," in order to make each a value for table with row and column equal to the # of adminlog.txt file.
'''
$data = file_get_contents($file_path.'/adminlog.txt');
$data = explode(",",$data);
$adminlog = array();
for ($i = 0; $i < sizeof($data); $i ++) {
array_push($adminlog,$data[$i]);
}
print($adminlog);
'''
Above was the code that I was trying to put in php in order to separate them by comma, but when I tried printing out $adminlog on my page, it would just show "Array". Is there actually way to separate the dataset neatly by "comma" and actually use the separated data and use it to create a table containing all information via loop?
Thanks so much in advance for y'all's enthusiasm and passion!