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]
Link to comment
Share on other sites

[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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.