Q:

Write a PHP script to replace multiple characters from the following string

0

Write a PHP script to replace multiple characters from the following string.

Sample String : '\"\1+2/3*2:2-3/4*3'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$my_str = '"\1+2/3*2:2-3/4*3';
echo str_replace(str_split('\\/:*?"<>|+-'), ' ', $my_str)."\n";
?>

Sample Output:

1 2 3 2 2 3 4 3

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now