Difference between revisions of "PHP: Nucleotide Fun"

From Pathology Education Instructional Resource
Jump to: navigation, search
(Created page with "Note: This is the PHP file that will run with the HTML file also titled Nucleotide Fun. <syntaxhighlight lang="php"> <?php $DNA = " does not contain U."; $RNA = " contain...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Note:  This is the PHP file that will run with the HTML file also titled Nucleotide Fun.
+
Note:  This is the PHP file that will run with the HTML file also titled [[HTML: Nucleotide Fun|Nucleotide Fun]].
  
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
Line 25: Line 25:
 
?>
 
?>
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 
{{This Is Your Brain On Informatics}}
 
{{This Is Your Brain On Informatics}}
 +
 +
[[Category:This Is Your Brain On Informatics]]

Latest revision as of 02:39, 19 March 2014

Note: This is the PHP file that will run with the HTML file also titled Nucleotide Fun.

<?php

	$DNA = " does not contain U.";
	$RNA = " contains U.";
	$seq = $_GET['seq'];
	
	for($i=0; $i<strlen($seq); $i++)
	{
		if($seq[$i] == 'U' || $seq[$i] == 'u')
		{
			echo "The input sequence is  RNA because RNA" . $RNA . "\n";
			break;
		}
		
		else if($i == strlen($seq)-1)
		{
			echo "The input sequence is DNA because DNA" . $DNA . "\n";
		}
		
	}

?>