Hi i hope you are doing well , as i can see you are trying to remove the extra backslashes from your domain you can use two methods pick whatever you want .
- Method 1:
Using stripslashes that will directly remove the extra backslashes,
$url = stripslashes('https:\/\/MYDOMAIN.com\/wp-content\/uploads\/wpcf7_drag-n-drop_uploads\/useruploads\/Jordan-2.pdf');
- Method 2:
You said that you tried string replace and find it hard i will explain how string replace work.
the str_replace function is used to replace specific parts of a string with new values.
as you can see it takes 3 parameters str_replace('search', 'replace', $originalString);
It scans the original string and replaces all occurrences of the search string with the corresponding replacement string. The modified string is then returned as the output.
this is the code you are gonna use :
$url = '["https:\/\/MYDOMAIN.com\/wp-content\/uploads\/wpcf7_drag-n-drop_uploads\/useruploads\/Jordan-2.pdf"]';
$url = str_replace(['"', '\\'], '', $url);
echo $url;
What I recommend is to use method 1 because it is easier to handle and to use.
I explained method 2 (str_replace) to you because I noticed that you had some difficulty with it.
I hope you find this information useful, even though my limited experience.
have a good day :)