help_needed Posted December 3, 2006 Share Posted December 3, 2006 <?php$read=file('std_info.txt');$n='0';while($n<sizeof($read)){$specific_info=explode(","$read[$n]);print "$specific_info";$n=$n+1;}?>please some one... ??? Link to comment https://forums.phpfreaks.com/topic/29316-resolved-whats-wrong-with-this-code/ Share on other sites More sharing options...
Psycho Posted December 3, 2006 Share Posted December 3, 2006 It would be REALLY helpful if you stated what errors you are getting. But, I do see some erros1. $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 https://forums.phpfreaks.com/topic/29316-resolved-whats-wrong-with-this-code/#findComment-134384 Share on other sites More sharing options...
keeB Posted December 3, 2006 Share Posted December 3, 2006 [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 https://forums.phpfreaks.com/topic/29316-resolved-whats-wrong-with-this-code/#findComment-134391 Share on other sites More sharing options...
help_needed Posted December 3, 2006 Author Share Posted December 3, 2006 thankyou for the replies Link to comment https://forums.phpfreaks.com/topic/29316-resolved-whats-wrong-with-this-code/#findComment-134398 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.