Jump to content

[SOLVED] array push


raman

Recommended Posts

I have a html page with three checkboxes to which I have given different names and different values 0, 1 and 2.

 

$hybpred=$_POST['hybpred'];
$sscpred=$_POST['sscpred'];
$pfams=$_POST['pfam'];

function get_svm_result($randi,$sqfile,$sscthresh,$hybthresh,$pthresh){
$str=array();

if ($sscpred==1){
   $strategy_name='Secondary Structure Composition';
   array_push($str, $strategy_name);
 }

 if ($hybpred==0){$strategy_name='PSSM+SSC hybrid model '; array_push($str, $strategy_name);}
 if  ($pfam==2){$strategy_name='Pfam prediction'; array_push($str, $strategy_name);}
}

echo "<TR><TD width=30%><font size=4><b>Prediction Strategy</TD><TD width=5%>:<TD>";foreach($str as $fdr){echo "$fdr ";}echo"</TD>";

 

But when wish to echo two or three elements of the array $str when the user selects two or three, I get only one element of the array. Please suggest why it's happening.

 

 

Link to comment
https://forums.phpfreaks.com/topic/156895-solved-array-push/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.