Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi G - M > Gestione dell'informazione nei sistemi mobili e pervasivi > array di oggetti PHP
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Spr1gg4N
.illuminato.

User info:
Registered: Sep 2007
Posts: 162 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 18:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
array di oggetti PHP

Ciao a tutti, qualcuno per caso saprebbe dirmi come fare un array di oggetti in PHP?
Non ho dimestichezza di programmazione ad oggetti con PHP e non riesco a trovare info a riguardo della sinstassi online.

Grazie in anticipo.

25-05-2009 19:37
Click Here to See the Profile for Spr1gg4N Click here to Send Spr1gg4N a Private Message Find more posts by Spr1gg4N Add Spr1gg4N to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lordghost
Black Lord

User info:
Registered: Oct 2005
Posts: 232 (0.03 al dì)
Location: Milan
Corso: Informatica
Anno: 3
Time Online: 2 Days, 9:48:49 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

basta fare un array, di oggetti. Non credo ci siano competenze specifiche. Sai fare gli array? Sai fare gli oggetti?
Se ho capito cosa cerchi:
$ar = array(new myClass(), ...);
array_push($ar, new myClass());
$ar[25] = new myClass();
$ar['pippo'] = new myClass();

ecco tutti i vari modi di utilizzo di un'array.

__________________
My 3D blog: http://www.webgl.it

26-05-2009 17:03
Click Here to See the Profile for lordghost Click here to Send lordghost a Private Message Visit lordghost's homepage! Find more posts by lordghost Add lordghost to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Spr1gg4N
.illuminato.

User info:
Registered: Sep 2007
Posts: 162 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 18:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

si thx per la risposta...alla fine ho trovato il modo..
in pratica non conoscendo a priori quanti oggetti avrei dovuto istanziare non sapevo bene come fare in PHP e alla fine ho scoperto che in PHP è possibile non dare una dimensione iniziale all'array quindi bastava che facevo per esempio:



code:
$arr = new array(); for($i = 0; $i<5; $i++) $arr[] = new Oggetto();

26-05-2009 17:57
Click Here to See the Profile for Spr1gg4N Click here to Send Spr1gg4N a Private Message Find more posts by Spr1gg4N Add Spr1gg4N to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 20:36.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.038 seconds (80.59% PHP - 19.41% MySQL) con 27 query.