I am trying to echo certain letters of a string where if a letter has already been echoed it cannot be echoed again.
Here is my current code:
<?php
$string = 'AABACADA';
echo $string[1];
echo $string[3];
echo $string[4];
echo $string[5];
echo $string[6];
echo $string[7];
?>
The result of this code is 'AACADA'. But I want to change the code so that a letter can only be echoed once, so the code's result should be 'ACD'.
I'm honestly stuck and would really appreciate some help. Thank you.