Wie kann ich das Array $arr außerhalb der Funktion aufrufen? Danke.
Abgesehen davon, dass deine Syntax falsch ist, entweder übergibst das Array als Rückgabewert(1) an den höheren scope, oder du registrierst die Variable als global(2) oder du arbeitest mit einem Referenzparameter(3).
function bla1(){
$arr = Array();
$arr[] = 34;
return $arr;
}
$arr = Array();
function bla2(){
global $arr;
$arr[] = 34;
}
$arr = Array();
function bla3(&$array){
$array[] = 34;
}
MfG
bubble
--
If "god" had intended us to drink beer, he would have given us stomachs. - David Daye
If "god" had intended us to drink beer, he would have given us stomachs. - David Daye