- str_replace: documentation ( source)
<?php
$ua = "Mozilla\\/5.0 (Linux; Android 6.0; HTC Desire 10 pro Build\\/MRA58K; wv) AppleWebKit\\/537.36 (KHTML, like Gecko) Version\\/4.0 Chrome\\/104.0.5112.97 Mobile Safari\\/537.36 Instagram 278.0.0.22.117 Android (23\\/6.0; 480dpi; 1080x1920; HTC\\/htc; HTC Desire 10 pro; htc_a56dj_pro_dugl; mt6755; en_US; 471827231)";
$ua = str_replace('\\/', '/',$ua);
echo $ua;