ArnauDuran Posted June 28, 2006 Share Posted June 28, 2006 Hello people,I'm developing something in PHP and I have a question.I have an archive named [i]names.txt[/i], with four lines:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]MichaelDanielJacquesDavid[/quote]And I want to get a random name. I know how to open the file, and how to generate numbers, but, if, for example, I get number 3, I'd like the program to print 'Jacques', or if I get number 1, print 'Michael'.So, with fgets, how can I read the line I want?Many thanks, and I apologise for my english... :)Greetings from Girona, Spain Quote Link to comment https://forums.phpfreaks.com/topic/13127-fgets-question/ Share on other sites More sharing options...
ArnauDuran Posted June 29, 2006 Author Share Posted June 29, 2006 Well, I got it, thanks!(I used explode() function) Quote Link to comment https://forums.phpfreaks.com/topic/13127-fgets-question/#findComment-50747 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.