For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > May 2006 > Opening and Reading a txt file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Opening and Reading a txt file
Hugh Janus

2006-05-20, 3:58 am

Hey, Can someone please help me out with a quick code.
What I want is to get 1 thing out of this txt file:
http://de.www.ivao.aero/whazzup.txt what I want to get is the number of
"CONNECTED CLIENTS" at the top of the txt file.

Thanks
BW


Geoff Berrow

2006-05-20, 7:57 am

Message-ID: <446ebbee@news01.wxnz.net> from Hugh Janus contained the
following:

>Hey, Can someone please help me out with a quick code.
>What I want is to get 1 thing out of this txt file:
>http://de.www.ivao.aero/whazzup.txt what I want to get is the number of
>"CONNECTED CLIENTS" at the top of the txt file.


http://www.ckdog.co.uk/test/test.php

<?php
$array=file("http://de.www.ivao.aero/whazzup.txt");
echo substr($array[4],-4);
?>

--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
Rich

2006-05-21, 6:59 pm

Geoff,

Your test page only echoes it's filename, ie test.php.

Regards.

"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:d95u625996uokhk7vr8jotk5fu8hic7nn7@
4ax.com...
> Message-ID: <446ebbee@news01.wxnz.net> from Hugh Janus contained the
> following:
>
>
> http://www.ckdog.co.uk/test/test.php
>
> <?php
> $array=file("http://de.www.ivao.aero/whazzup.txt");
> echo substr($array[4],-4);
> ?>
>
> --
> Geoff Berrow 0110001001101100010000000110
> 0011011010110110010001101111011001110010
11
> 1001100011011011110010111001110101011010
11



Geoff Berrow

2006-05-21, 6:59 pm

Message-ID: <70%bg.73010$wl.27251@text.news.blueyonder.co.uk> from Rich
contained the following:

>Geoff,
>
>Your test page only echoes it's filename, ie test.php.



Ah, sorry, test.php doesn't hang around long. :-}

Try it now.


--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com