Php Replace Character From Array Python Methods