Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.