Sat 5 Jun, 2010 03:24 pm
I have a site that is using parse_url in this command:
<?php $domain = parse_url($row['buyfrom'], PHP_URL_HOST); ?>
buyfrom is a url and in this case the specific url I having difficulty with is very long:
I'm getting all kinds of errors. Is there a way to fix this command so that it can handle the long url like this one? I'm assuming the length of the URL is the issue.
Apparently, this line of code serves to extract the URL's domain. So why not precede it with a line that cuts off the URL after the top-level domain(".com" in this case), pass the so-tuncated url to to parse_url(), and see if the error messages go away?