## [PHP] a for loop and probability random all i need is make them to reverse

### [PHP] a for loop and probability random all i need is make them to reverse

That should output the full line now
<?

\$prExample = new probabilityRandom;

function arasi(\$a,\$b,\$data)
{
\$x = explode(\$a,\$data);
\$z = explode(\$b,\$x[1]);
\$oh = \$z[0];
if(\$x && \$z) { return \$oh; } else { return false; }
}

\$x = gzinflate(base64_decode(\$x));
\$xx=explode("
",\$x);
\$xcx=array();

foreach(\$xx as \$c => \$y)
{
\$yy = arasi(" in ",")",\$y);
\$yy = str_replace(",","",\$yy);
\$xcx[]=\$yy;
#echo \$yy."<br>";
\$itemisim = explode("(",\$y);
\$itemisim=\$itemisim[0];
\$xcx[isim][]=\$itemisim;
}
for(\$i=0;\$i<=count(\$xcx)-1;\$i++)
{
\$prExample->add( \$xx[\$i], \$xcx[\$i] ); // <-- changed to \$xx[i]
}
print \$prExample->get();

class probabilityRandom {
#private vars
var
\$data = array(),
\$universe = 0;
#add an item to the list and defines its probability of beeing chosen
\$this->data[ \$x = sizeof( \$this->data ) ] = new stdClass;
\$this->data[ \$x ]->value = \$data;
\$this->universe += \$this->data[ \$x ]->probability = abs( \$probability );
}
#remove an item from the list
function remove( \$index ){
if( \$index > -1 && \$index < sizeof( \$this->data ) ) {
\$item = array_splice( \$this->data, \$index, 1 );
\$this->universe -= \$item->probability;
}
}
#clears the class
function clear(){
\$this->universe = sizeof( \$this->data = array() );
}
#return a randomized item from the list
function get(){
if( !\$this->universe )
return null;
\$x = round( mt_rand( 0, \$this->universe ) );
\$max = \$i = 0;
do
\$max += \$this->data[ \$i++ ]->probability;
while( \$x > \$max );
return \$this->data[ \$i-1 ]->value;
}
}
?>

I am trying to write a paper, and I must have messed something up on my
settings. Everytime I try to use the quotations button on my keypad, it
comes up as a weird A that looks to be in a different language. The same
thing is happening with my apostrophe key... can anyone help?