I have the following string:
<data value="https://thisurl.com">One description</data>
<data value="https://thaturl.com">Another description</data>
I want to display only the text inside the double quotes, in this case the urls. I'm using the following code:
<?php
preg_match_all('/".*?"|\'.*?\'/', $input, $array);
foreach ($array[0] as $key => $value) {
echo $value;
}
This code extracts the urls from the string but is adding single quotes and I need the plain url without single or double quotes:
'https://thisurl.com' 'https://thatsurl.com'
Any ideas how to fix this?