Mailinglisten-Archive |
Nils Meyer wrote:
> > Ticks.
> Wie setzt man die Dinger ein? Hat jemand ein Beispiel?
<?
function foo($str) {
static $i = 0;
print "$str: $i<br>\n";
$i++;
}
register_tick_function("foo", "count");
declare (ticks = 6) {
for($i=0; $i<20; $i++) {
echo "$i<br>\n";
}
}
?>
Ausgabe
0
1
2
count: 0
3
4
5
count: 1
6
7
8
count: 2
9
10
11
count: 3
12
13
14
count: 4
15
16
17
count: 5
18
19
count: 6
--
sebastian bergmann sb_(at)_sebastian-bergmann.de
http://www.sebastian-bergmann.de
bonn.phpug.de | www.php.net | www.phpOpenTracker.de | www.titanchat.de
php::bar PHP Wiki - Listenarchive