Alex Alex - 5 months ago 42
PHP Question

Getting %3F on URLs

I'm using simplehtmldom and I'm trying to get all links from a website. This is my script:


// get DOM from URL or file
$html = file_get_html('');

// find all a tags
foreach($html->find('a') as $e)
echo $e->href . "\n";

What I'm getting is the full list of urls but some of them end with a %3F where there sould be a string. Something like:

Instead of:

I've done some research and it seems the fix needs to be done on the Apache server bu tI don't have access to it, is there anything I could do to fix it?


Just decode incoming url like this :

echo urldecode($e->href)."\n";

It will give the decoded url for string.