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... ??? Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
help_needed Posted December 3, 2006 Author Share Posted December 3, 2006 thankyou for the replies Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.