Pogledajte određenu poruku
Staro 06. 02. 2006.   #1
bojan_bozovic
expert
Master
 
Avatar bojan_bozovic
 
Datum učlanjenja: 20.12.2005
Poruke: 730
Hvala: 0
0 "Hvala" u 0 poruka
bojan_bozovic is on a distinguished road
Default vracanje niza iz funkcije

Kôd:
<?php

class test {
    function test() {
       for ($i=0;$i<=9;$i++) {
          $x[$i]=$i*$i; /* Nebitno */
        }
    }
    function getarray() {
       return $this->x;
     }
} /* end test */

$test1 = new test;
$arr=$test1->getarray();
print_r $arr;
?>
i dobijam 'unexpected T_VARIABLE'

Nadam se da cete mi pomoci.
bojan_bozovic je offline   Odgovorite uz citat