|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-01-20 18:34 UTC] info at netmosfera dot it
Description:
------------
hello
please read the code!
hth
Reproduce code:
---------------
interface FirstLast //? lol!
{
public function (Boolean) isFirst();
public function (Boolean) isLast();
}
$x= new ArrayObject(Array(1,2,3,4,5,6,7)); // implements this..
foreach($x as $item)
{
if($x->isFirst()) echo "<ul>";
echo "<li>" . $item . "</li>";
if($x->isLast()) echo "</ul>";
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 UTC |
another useful interface: interface PrintReadable { public printR(); } print_r(new ArrayObject(.....)); useful to improve readability on items like this: ArrayObject Object ( [storage:ArrayObject:private] => Array ( [0] => ArrayObject Object ( [storage:ArrayObject:private] => Array ( [0] => ArrayObject Object ( [storage:ArrayObject:private] => Array ( ) ) ) ) [1] => ciao ) )