🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #10974

Re: PHP vraagje

#10974
From: Daniel Tryba
Date: Wed, 20 Feb 2002 02:40
33 lines
1796 bytes
Me <whynot-verwijderdit-@pandora.be> wrote:
> Dus bijvoorbeeld het is nu half ??n, dan gaat hij kijken in het txt-filetje:
> 00 - 01: maan.jpg - Om kwart voor 3 's middag : 14 - 15: zon.jpg

> Hoe los ik dit op?

00:30 -> 0
14:45 -> 14

date("H",time());//[1][2]

Maak een tekstfile met 24 regels waar alleen maar de naam van het
plaatje op staat:

maan.jpg
...
zon.jpg
...
maan.jpg

lees file met file()[3] en pak het element x[4] (is de intval()[5] van de
date()).

[1]
http://www.php.net/manual/en/function.date.php
[2]
http://www.php.net/manual/en/function.time.php
[3]
http://www.php.net/manual/en/function.file.php
[4]
http://www.php.net/manual/en/language.types.array.php
[5]
http://www.php.net/manual/en/function.intval.php
Technical Details
Message-ID: <m82v4a.b12.ln@news.canopus.nl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!proxad.net!newshub.bart.net!typhoon.bart.nl!not-for-mail
References: <YIBc8.45287$kZ6.2472597761@hestia.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: 107324,9da8b12d25c0211e
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,9da8b12d25c0211e
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2002-02-19 18:40:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!proxad.net!newshub.bart.net!typhoon.bart.nl!not-for-mail
From: Daniel Tryba <news_be.comp.programming@canopus.nl>
Subject: Re: PHP vraagje
Newsgroups: be.comp.programming,nl.comp.programmeren
References: <YIBc8.45287$kZ6.2472597761@hestia.telenet-ops.be>
User-Agent: tin/1.5.9-20010723 ("Chord of Souls") (UNIX) (Linux/2.4.13 (i686))
Message-ID: <m82v4a.b12.ln@news.canopus.nl>
Lines: 34
Date: Wed, 20 Feb 2002 02:40:13 GMT
NNTP-Posting-Host: 212.61.52.34
X-Complaints-To: abuse@vianetworks.nl
X-Trace: typhoon.bart.nl 1014172813 212.61.52.34 (Wed, 20 Feb 2002 03:40:13 MET)
NNTP-Posting-Date: Wed, 20 Feb 2002 03:40:13 MET