Changes

Jump to: navigation, search

PHP: Nucleotide Fun

538 bytes added, 05:39, 24 October 2013
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..."
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 = " 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";
}

}

?>
</syntaxhighlight>
{{This Is Your Brain On Informatics}}
347
edits

Navigation menu