Jump to content

[ resolved ]whats wrong with this code?


help_needed

Recommended Posts

It would be REALLY helpful if you stated what errors you are getting. But, I do see some erros

1. $n='0';
PHP will probably interpret that correctly when you later use $n as a number, but you are defining it here as a string because of the quote marks. Should just be [b]$n = 0;[/b]

2. $specific_info=explode(","$read[$n]);
You are using a comma character as the delimiter for the explode command, but you need a comma between the delimiter and the array [b]$specific_info=explode(",", $read[$n]);[/b]
[code=php:0]
$fs_fileHandler = fopen("std_info.txt", "r");
$specific_info = fread($fs_fileHandler, filesize("std_info.txt"); // gets all information in the text file to the $specific_info
$specific_info = explode(",", $specific_info);
foreach($specific_info as $value) {
print $value . "<br>";
}
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.