I am working on Do While loop
in my project its working fine first time.
Before while statement
, I assigned a value to an array I could able to print the array successfully at bottom of the code, BUT its become 0 when I check at top of the loop.
Code:
$looparray = array();
$loopend = 0;
$arraymer = array();
$poolafirtsid = $previous_array_values; //previous array values
do {
if (sizeof($looparray) == 0) {
$firstsponarray = $poolafirtsid;
} else {
$firstsponarray = $looparray;
}
$firstsponarray = getUserArray($poolafirtsid);
//get user arraylist of first
foreach ($firstsponarray as $avalue) {
$rooparray = membercount($avalue);
$bsponarray = getUserArray($avalue);
//get second users arraylist 9
if (sizeof($bsponarray > 0)) {
$barraymer = array_merge($barraymer, $bsponarray);
}
$aarraylist[$avalue] = $rooparray;
}
$asmallestsponid = getSmallestID($aarraylist);
//get smallest id in the array
if (membercount($asmallestsponid) < 3) {
$loopend = 1;
} else {
global $pooldata;
if (count($barraymer) > 0) {
$pooldata = $barraymer;
}
print_r($pooldata);
}
} while ($loopend == 1);
When I print in else its working but I am unable to print starting of do loop its showing array size is 0