ruslanashaari
9/8/2017 - 12:27 AM

Given a DNA strand, return its RNA complement (per RNA transcription) #exercism

Given a DNA strand, return its RNA complement (per RNA transcription) #exercism

<?php
function toRna($nucleotides) {
	
	$dnaToRna = [
		"G" => "C",
		"C" => "G",
		"T" => "A",
		"A" => "U"
	];
	return strtr(strtoupper($nucleotides), $dnaToRna);
  //php strtr will replace the first parameter with its complement value in second parameter
}