How to replace string with another array string in php
<p>Actually I want to convert the string that I enter in input text, and then compare to another array.. See scenario below:</p>

<p>First, I enter this type of string in input text: <code>acgta</code>
Second, I want to replace the "acgta" to the "TGCAT" which is <code>a=T, c=G, g=C</code></p>

<p>This is code:</p>

<pre><code>$data = "acgta";
$s = str_split($data);

$d = array("a" =&gt; "T","g" =&gt; "C","c" =&gt; "G","t" =&gt; "A");

foreach($d as $key1 =&gt; $value1) {
        echo str_replace($key1,$value1,$data);}
</code></pre>
